(function(g) {
        var window = this;
        var pDa = function(a, b) {
            return g.Wb(a, b)
        }
            , m6 = function(a) {
            g.Qm(a, "zx", g.yb());
            return a
        }
            , n6 = function(a, b, c) {
            g.za(c) || (c = [String(c)]);
            g.Tm(a.o, b, c)
        }
            , qDa = function(a, b) {
            var c = [];
            g.Ek(b, function(a) {
                try {
                    var b = g.tD.prototype.A.call(this, a, !0)
                } catch (f) {
                    if ("Storage: Invalid value was encountered" == f)
                        return;
                    throw f;
                }
                g.u(b) ? g.sD(b) && c.push(a) : c.push(a)
            }, a);
            return c
        }
            , rDa = function(a, b) {
            var c = qDa(a, b);
            (0,
                g.C)(c, function(a) {
                g.tD.prototype.remove.call(this, a)
            }, a)
        }
            , sDa = function(a) {
            if (a.Ed) {
                if (a.Ed.locationOverrideToken)
                    return {
                        locationOverrideToken: a.Ed.locationOverrideToken
                    };
                if (null != a.Ed.latitudeE7 && null != a.Ed.longitudeE7)
                    return {
                        latitudeE7: a.Ed.latitudeE7,
                        longitudeE7: a.Ed.longitudeE7
                    }
            }
            return null
        }
            , tDa = function(a, b, c, d) {
            var e = new g.Hm(null,void 0);
            a && g.Im(e, a);
            b && g.Jm(e, b);
            c && g.Km(e, c);
            d && g.Lm(e, d);
            return e
        }
            , uDa = function(a) {
            g.hG[a] && (a = g.hG[a],
                (0,
                    g.C)(a, function(a) {
                    g.fG[a] && delete g.fG[a]
                }),
                a.length = 0)
        }
            , vDa = function(a) {
            var b = g.eG();
            if (b)
                if (b.clear(a),
                    a)
                    uDa(a);
                else
                    for (var c in g.hG)
                        uDa(c)
        }
            , o6 = function(a) {
            this.app = this.name = this.id = "";
            this.type = "REMOTE_CONTROL";
            this.obfuscatedGaiaId = this.avatar = this.username = "";
            this.B = !1;
            this.capabilities = new window.Set;
            this.experiments = new window.Set;
            this.theme = "u";
            new g.Bm;
            this.o = this.A = "";
            a && (this.id = a.id || a.name,
                this.name = a.name,
                this.app = a.app,
                this.type = a.type || "REMOTE_CONTROL",
                this.username = a.user || "",
                this.avatar = a.userAvatarUri || "",
                this.obfuscatedGaiaId = a.obfuscatedGaiaId || "",
                this.theme = a.theme || "u",
                wDa(this, a.capabilities || ""),
                xDa(this, a.experiments || ""),
                this.A = a.remoteControllerUrl || "",
                this.o = a.localChannelEncryptionKey || "")
        }
            , wDa = function(a, b) {
            a.capabilities.clear();
            (0,
                g.Td)(b.split(","), g.Fa(pDa, yDa)).forEach(function(b) {
                a.capabilities.add(b)
            })
        }
            , xDa = function(a, b) {
            a.experiments.clear();
            b.split(",").forEach(function(b) {
                a.experiments.add(b)
            })
        }
            , p6 = function(a) {
            a = a || {};
            this.name = a.name || "";
            this.id = a.id || a.screenId || "";
            this.token = a.token || a.loungeToken || "";
            this.uuid = a.uuid || a.dialId || ""
        }
            , q6 = function(a, b) {
            return !!b && (a.id == b || a.uuid == b)
        }
            , zDa = function(a) {
            return {
                name: a.name,
                screenId: a.id,
                loungeToken: a.token,
                dialId: a.uuid
            }
        }
            , ADa = function(a) {
            return new p6(a)
        }
            , BDa = function(a) {
            return g.za(a) ? (0,
                g.I)(a, ADa) : []
        }
            , r6 = function(a) {
            return a ? '{name:"' + a.name + '",id:' + a.id.substr(0, 6) + "..,token:" + (a.token ? ".." + a.token.slice(-6) : "-") + ",uuid:" + (a.uuid ? ".." + a.uuid.slice(-6) : "-") + "}" : "null"
        }
            , s6 = function(a) {
            return g.za(a) ? "[" + (0,
                g.I)(a, r6).join(",") + "]" : "null"
        }
            , t6 = function() {
            return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(a) {
                var b = 16 * Math.random() | 0;
                return ("x" == a ? b : b & 3 | 8).toString(16)
            })
        }
            , CDa = function(a) {
            return (0,
                g.I)(a, function(a) {
                return {
                    key: a.id,
                    name: a.name
                }
            })
        }
            , u6 = function(a, b) {
            return g.Ka(a, function(a) {
                return a || b ? !a != !b ? !1 : a.id == b.id : !0
            })
        }
            , v6 = function(a, b) {
            return g.Ka(a, function(a) {
                return q6(a, b)
            })
        }
            , DDa = function() {
            var a = (0,
                g.dH)();
            a && rDa(a, a.o.Zd(!0))
        }
            , w6 = function() {
            var a = g.gH("yt-remote-connected-devices") || [];
            g.fb(a);
            return a
        }
            , EDa = function(a) {
            if (g.Pa(a))
                return [];
            var b = a[0].indexOf("#")
                , c = -1 == b ? a[0] : a[0].substring(0, b);
            return (0,
                g.I)(a, function(a, b) {
                return 0 == b ? a : a.substring(c.length)
            })
        }
            , FDa = function(a) {
            g.fH("yt-remote-connected-devices", a, 86400)
        }
            , y6 = function() {
            if (x6)
                return x6;
            var a = g.gH("yt-remote-device-id");
            a || (a = t6(),
                g.fH("yt-remote-device-id", a, 31536E3));
            for (var b = w6(), c = 1, d = a; g.Oa(b, d); )
                c++,
                    d = a + "#" + c;
            return x6 = d
        }
            , z6 = function() {
            var a = w6()
                , b = y6();
            g.Oa(a, b);
            g.iH() && g.ib(a, b);
            a = EDa(a);
            if (g.Pa(a))
                try {
                    g.QG("remote_sid")
                } catch (c) {}
            else
                try {
                    g.PG("remote_sid", a.join(","), -1)
                } catch (c) {}
        }
            , GDa = function() {
            return g.gH("yt-remote-session-browser-channel")
        }
            , HDa = function() {
            return g.gH("yt-remote-local-screens") || []
        }
            , IDa = function() {
            g.fH("yt-remote-lounge-token-expiration", !0, 86400)
        }
            , JDa = function(a) {
            5 < a.length && (a = a.slice(a.length - 5));
            var b = (0,
                g.I)(HDa(), function(a) {
                return a.loungeToken
            })
                , c = (0,
                g.I)(a, function(a) {
                return a.loungeToken
            });
            (0,
                g.pm)(c, function(a) {
                return !g.Oa(b, a)
            }) && IDa();
            g.fH("yt-remote-local-screens", a, 31536E3)
        }
            , KDa = function(a, b) {
            g.fH("yt-remote-session-browser-channel", a);
            g.fH("yt-remote-session-screen-id", b);
            var c = w6()
                , d = y6();
            g.Oa(c, d) || c.push(d);
            FDa(c);
            z6()
        }
            , A6 = function(a) {
            a || (g.hH("yt-remote-session-screen-id"),
                g.hH("yt-remote-session-video-id"));
            z6();
            a = w6();
            g.Ta(a, y6());
            FDa(a)
        }
            , LDa = function() {
            if (!B6) {
                var a = g.ED();
                a && (B6 = new g.nD(a))
            }
            return B6 ? !!B6.get("yt-remote-use-staging-server") : !1
        }
            , MDa = function() {
            var a = window.document.createElement("a");
            g.hd(a, "https://www.gstatic.com/cv/js/sender/v1/cast_sender.js");
            a = a.href.replace(/^[a-zA-Z]+:\/\//, "//");
            return "js-" + g.Cb(a)
        }
            , NDa = function(a, b) {
            var c = g.Ld("SCRIPT");
            c.id = a;
            c.onload = function() {
                b && (0,
                    window.setTimeout)(b, 0)
            }
            ;
            c.onreadystatechange = function() {
                switch (c.readyState) {
                    case "loaded":
                    case "complete":
                        c.onload()
                }
            }
            ;
            g.id(c, g.je("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js"));
            var d = window.document.getElementsByTagName("head")[0] || window.document.body;
            d.insertBefore(c, d.firstChild);
            return c
        }
            , ODa = function() {
            var a = MDa()
                , b = window.document.getElementById(a)
                , c = b && g.qF(b, "loaded");
            c || b && !c || (b = NDa(a, function() {
                g.qF(b, "loaded") || (g.pF(b, "loaded", "true"),
                    g.lG(a),
                    g.mE(g.Fa(vDa, a), 0))
            }))
        }
            , C6 = function(a) {
            return !!window.document.currentScript && (-1 != window.document.currentScript.src.indexOf("?" + a) || -1 != window.document.currentScript.src.indexOf("&" + a))
        }
            , PDa = function() {
            return "function" == typeof window.__onGCastApiAvailable ? window.__onGCastApiAvailable : null
        }
            , D6 = function(a) {
            a.length ? QDa(a.shift(), function() {
                D6(a)
            }) : E6()
        }
            , RDa = function(a) {
            return "chrome-extension://" + a + F6
        }
            , QDa = function(a, b, c) {
            var d = window.document.createElement("script");
            d.onerror = b;
            c && (d.onload = c);
            d.src = a;
            (window.document.head || window.document.documentElement).appendChild(d)
        }
            , G6 = function(a) {
            return 0 <= window.navigator.userAgent.indexOf(a)
        }
            , E6 = function() {
            var a = PDa();
            a && a(!1, "No cast extension found")
        }
            , H6 = function() {
            if (SDa) {
                var a = 2
                    , b = PDa()
                    , c = function() {
                    a--;
                    0 == a && b && b(!0)
                };
                window.__onGCastApiAvailable = c;
                QDa("//www.gstatic.com/cast/sdk/libs/sender/1.0/cast_framework.js", E6, c)
            }
        }
            , TDa = function() {
            var a = window.__gCrWeb && window.__gCrWeb.message && window.__gCrWeb.message.invokeOnHost;
            a && (H6(),
                a({
                    command: "cast.sender.init"
                }))
        }
            , UDa = function() {
            H6();
            var a = window.navigator.userAgent.match(/Chrome\/([0-9]+)/);
            D6(["//www.gstatic.com/eureka/clank/" + (a ? (0,
                window.parseInt)(a[1], 10) : 0) + F6, "//www.gstatic.com/eureka/clank" + F6])
        }
            , I6 = function(a, b, c) {
            g.M.call(this);
            this.F = null != c ? (0,
                g.A)(a, c) : a;
            this.wd = b;
            this.D = (0,
                g.A)(this.DK, this);
            this.o = !1;
            this.A = 0;
            this.B = this.Fa = null;
            this.C = []
        }
            , J6 = function() {}
            , K6 = function(a, b, c, d) {
            this.o = a;
            this.B = b;
            this.G = c;
            this.F = d || 1;
            this.C = 45E3;
            this.Y = new g.Xm(this);
            this.A = new g.Cg;
            this.A.setInterval(250)
        }
            , WDa = function(a, b, c) {
            a.Zj = 1;
            a.zh = m6(b.clone());
            a.fj = c;
            a.D = !0;
            VDa(a, null)
        }
            , L6 = function(a, b, c, d, e) {
            a.Zj = 1;
            a.zh = m6(b.clone());
            a.fj = null;
            a.D = c;
            e && (a.LE = !1);
            VDa(a, d)
        }
            , VDa = function(a, b) {
            a.Qk = (0,
                g.G)();
            M6(a);
            a.bi = a.zh.clone();
            n6(a.bi, "t", a.F);
            a.mn = 0;
            a.Rc = a.o.rs(a.o.Zm() ? b : null);
            0 < a.Zs && (a.hq = new g.hl((0,
                g.A)(a.bG, a, a.Rc),a.Zs));
            a.Y.W(a.Rc, "readystatechange", a.cW);
            var c = a.Ei ? g.ec(a.Ei) : {};
            a.fj ? (a.Wq = "POST",
                c["Content-Type"] = "application/x-www-form-urlencoded",
                a.Rc.send(a.bi, a.Wq, a.fj, c)) : (a.Wq = "GET",
            a.LE && !g.Hd && (c.Connection = "close"),
                a.Rc.send(a.bi, a.Wq, null, c));
            a.o.Bf(1)
        }
            , ZDa = function(a, b, c) {
            for (var d = !0; !a.pi && a.mn < c.length; ) {
                var e = XDa(a, c);
                if (e == N6) {
                    4 == b && (a.Ah = 4,
                        O6(15),
                        d = !1);
                    break
                } else if (e == YDa) {
                    a.Ah = 4;
                    O6(16);
                    d = !1;
                    break
                } else
                    P6(a, e)
            }
            4 == b && 0 == c.length && (a.Ah = 1,
                O6(17),
                d = !1);
            a.Hf = a.Hf && d;
            d || (Q6(a),
                R6(a))
        }
            , XDa = function(a, b) {
            var c = a.mn
                , d = b.indexOf("\n", c);
            if (-1 == d)
                return N6;
            c = Number(b.substring(c, d));
            if ((0,
                window.isNaN)(c))
                return YDa;
            d += 1;
            if (d + c > b.length)
                return N6;
            var e = b.substr(d, c);
            a.mn = d + c;
            return e
        }
            , aEa = function(a, b) {
            a.Qk = (0,
                g.G)();
            M6(a);
            var c = b ? window.location.hostname : "";
            a.bi = a.zh.clone();
            g.Qm(a.bi, "DOMAIN", c);
            g.Qm(a.bi, "t", a.F);
            try {
                a.If = new window.ActiveXObject("htmlfile")
            } catch (n) {
                Q6(a);
                a.Ah = 7;
                O6(22);
                R6(a);
                return
            }
            var d = "<html><body>";
            if (b) {
                for (var e = "", f = 0; f < c.length; f++) {
                    var k = c.charAt(f);
                    if ("<" == k)
                        e += "\\x3c";
                    else if (">" == k)
                        e += "\\x3e";
                    else {
                        var l = k;
                        if (l in S6)
                            k = S6[l];
                        else if (l in $Da)
                            k = S6[l] = $Da[l];
                        else {
                            var m = l.charCodeAt(0);
                            if (31 < m && 127 > m)
                                k = l;
                            else {
                                if (256 > m) {
                                    if (k = "\\x",
                                    16 > m || 256 < m)
                                        k += "0"
                                } else
                                    k = "\\u",
                                    4096 > m && (k += "0");
                                k += m.toString(16).toUpperCase()
                            }
                            k = S6[l] = k
                        }
                        e += k
                    }
                }
                d += '<script>document.domain="' + e + '"\x3c/script>'
            }
            d += "</body></html>";
            c = g.jd(g.Bc("b/12014412"), d);
            a.If.open();
            a.If.write(g.ad(c));
            a.If.close();
            a.If.parentWindow.m = (0,
                g.A)(a.iV, a);
            a.If.parentWindow.d = (0,
                g.A)(a.UD, a, !0);
            a.If.parentWindow.rpcClose = (0,
                g.A)(a.UD, a, !1);
            c = a.If.createElement("DIV");
            a.If.parentWindow.document.body.appendChild(c);
            d = g.Qc(a.bi.toString());
            d = g.rb(g.Nc(d));
            d = g.jd(g.Bc("b/12014412"), '<iframe src="' + d + '"></iframe>');
            g.gd(c, g.ad(d));
            a.o.Bf(1)
        }
            , M6 = function(a) {
            a.Iw = (0,
                g.G)() + a.C;
            bEa(a, a.C)
        }
            , bEa = function(a, b) {
            if (null != a.ll)
                throw Error("WatchDog timer not null");
            a.ll = T6((0,
                g.A)(a.yV, a), b)
        }
            , U6 = function(a) {
            a.ll && (g.x.clearTimeout(a.ll),
                a.ll = null)
        }
            , R6 = function(a) {
            a.o.Yz() || a.pi || a.o.Sp(a)
        }
            , Q6 = function(a) {
            U6(a);
            g.kf(a.hq);
            a.hq = null;
            a.A.stop();
            g.cn(a.Y);
            if (a.Rc) {
                var b = a.Rc;
                a.Rc = null;
                b.abort();
                b.dispose()
            }
            a.If && (a.If = null)
        }
            , P6 = function(a, b) {
            try {
                a.o.MD(a, b),
                    a.o.Bf(4)
            } catch (c) {}
        }
            , dEa = function(a, b, c, d, e) {
            if (0 == d)
                c(!1);
            else {
                var f = e || 0;
                d--;
                cEa(a, b, function(e) {
                    e ? c(!0) : g.x.setTimeout(function() {
                        dEa(a, b, c, d, f)
                    }, f)
                })
            }
        }
            , cEa = function(a, b, c) {
            var d = new window.Image;
            d.onload = function() {
                try {
                    V6(d),
                        c(!0)
                } catch (e) {}
            }
            ;
            d.onerror = function() {
                try {
                    V6(d),
                        c(!1)
                } catch (e) {}
            }
            ;
            d.onabort = function() {
                try {
                    V6(d),
                        c(!1)
                } catch (e) {}
            }
            ;
            d.ontimeout = function() {
                try {
                    V6(d),
                        c(!1)
                } catch (e) {}
            }
            ;
            g.x.setTimeout(function() {
                if (d.ontimeout)
                    d.ontimeout()
            }, b);
            d.src = a
        }
            , V6 = function(a) {
            a.onload = null;
            a.onerror = null;
            a.onabort = null;
            a.ontimeout = null
        }
            , eEa = function(a) {
            this.o = a;
            this.A = new J6
        }
            , fEa = function(a) {
            var b = W6(a.o, a.wl, "/mail/images/cleardot.gif");
            m6(b);
            dEa(b.toString(), 5E3, (0,
                g.A)(a.HJ, a), 3, 2E3);
            a.Bf(1)
        }
            , Y6 = function(a) {
            var b = a.o.J;
            if (null != b)
                O6(5),
                    b ? (O6(11),
                        X6(a.o, a, !1)) : (O6(12),
                        X6(a.o, a, !0));
            else if (a.Be = new K6(a,void 0,void 0,void 0),
                a.Be.Ei = a.Xs,
                b = a.o,
                b = W6(b, b.Zm() ? a.Wl : null, a.Ys),
                O6(5),
            !g.Fd || g.uc(10))
                n6(b, "TYPE", "xmlhttp"),
                    L6(a.Be, b, !1, a.Wl, !1);
            else {
                n6(b, "TYPE", "html");
                var c = a.Be;
                a = !!a.Wl;
                c.Zj = 3;
                c.zh = m6(b.clone());
                aEa(c, a)
            }
        }
            , Z6 = function(a, b, c) {
            this.o = 1;
            this.A = [];
            this.C = [];
            this.D = new J6;
            this.H = a || null;
            this.J = null != b ? b : null;
            this.F = c || !1
        }
            , gEa = function(a, b) {
            this.o = a;
            this.map = b;
            this.context = null
        }
            , hEa = function(a) {
            g.mf.call(this, "statevent", a)
        }
            , iEa = function(a, b) {
            g.mf.call(this, "timingevent", a);
            this.size = b
        }
            , jEa = function(a) {
            g.mf.call(this, "serverreachability", a)
        }
            , mEa = function(a) {
            kEa(a);
            if (3 == a.o) {
                var b = a.Im++
                    , c = a.yo.clone();
                g.Qm(c, "SID", a.B);
                g.Qm(c, "RID", b);
                g.Qm(c, "TYPE", "terminate");
                $6(a, c);
                b = new K6(a,a.B,b,void 0);
                b.Zj = 2;
                b.zh = m6(c.clone());
                (new window.Image).src = b.zh;
                b.Qk = (0,
                    g.G)();
                M6(b)
            }
            lEa(a)
        }
            , nEa = function(a) {
            a.dK(1, 0);
            a.yo = W6(a, null, a.Ws);
            a7(a)
        }
            , kEa = function(a) {
            a.nh && (a.nh.abort(),
                a.nh = null);
            a.wc && (a.wc.cancel(),
                a.wc = null);
            a.zg && (g.x.clearTimeout(a.zg),
                a.zg = null);
            b7(a);
            a.fe && (a.fe.cancel(),
                a.fe = null);
            a.rh && (g.x.clearTimeout(a.rh),
                a.rh = null)
        }
            , oEa = function(a, b) {
            if (0 == a.o)
                throw Error("Invalid operation: sending map when state is closed");
            a.A.push(new gEa(a.VQ++,b));
            2 != a.o && 3 != a.o || a7(a)
        }
            , a7 = function(a) {
            a.fe || a.rh || (a.rh = T6((0,
                g.A)(a.SD, a), 0),
                a.Nj = 0)
        }
            , qEa = function(a, b) {
            if (1 == a.o) {
                if (!b) {
                    a.Im = Math.floor(1E5 * Math.random());
                    var c = a.Im++
                        , d = new K6(a,"",c,void 0);
                    d.Ei = null;
                    var e = c7(a)
                        , f = a.yo.clone();
                    g.Qm(f, "RID", c);
                    g.Qm(f, "CVER", "1");
                    $6(a, f);
                    WDa(d, f, e);
                    a.fe = d;
                    a.o = 2
                }
            } else
                3 == a.o && (b ? pEa(a, b) : 0 == a.A.length || a.fe || pEa(a))
        }
            , pEa = function(a, b) {
            if (b)
                if (6 < a.si) {
                    a.A = a.C.concat(a.A);
                    a.C.length = 0;
                    var c = a.Im - 1;
                    var d = c7(a)
                } else
                    c = b.G,
                        d = b.fj;
            else
                c = a.Im++,
                    d = c7(a);
            var e = a.yo.clone();
            g.Qm(e, "SID", a.B);
            g.Qm(e, "RID", c);
            g.Qm(e, "AID", a.nk);
            $6(a, e);
            c = new K6(a,a.B,c,a.Nj + 1);
            c.Ei = null;
            c.setTimeout(1E4 + Math.round(1E4 * Math.random()));
            a.fe = c;
            WDa(c, e, d)
        }
            , $6 = function(a, b) {
            if (a.ud) {
                var c = a.ud.Fz();
                c && g.Lb(c, function(a, c) {
                    g.Qm(b, c, a)
                })
            }
        }
            , c7 = function(a) {
            var b = Math.min(a.A.length, 1E3)
                , c = ["count=" + b];
            if (6 < a.si && 0 < b) {
                var d = a.A[0].o;
                c.push("ofs=" + d)
            } else
                d = 0;
            for (var e = 0; e < b; e++) {
                var f = a.A[e].o
                    , k = a.A[e].map;
                f = 6 >= a.si ? e : f - d;
                try {
                    g.Lb(k, function(a, b) {
                        c.push("req" + f + "_" + b + "=" + (0,
                            window.encodeURIComponent)(a))
                    })
                } catch (l) {
                    c.push("req" + f + "_type=" + (0,
                        window.encodeURIComponent)("_badmap"))
                }
            }
            a.C = a.C.concat(a.A.splice(0, b));
            return c.join("&")
        }
            , rEa = function(a) {
            a.wc || a.zg || (a.G = 1,
                a.zg = T6((0,
                    g.A)(a.RD, a), 0),
                a.Bj = 0)
        }
            , d7 = function(a) {
            if (a.wc || a.zg || 3 <= a.Bj)
                return !1;
            a.G++;
            a.zg = T6((0,
                g.A)(a.RD, a), sEa(a, a.Bj));
            a.Bj++;
            return !0
        }
            , X6 = function(a, b, c) {
            a.Vq = c;
            a.Wf = b.Lg;
            a.F || nEa(a)
        }
            , b7 = function(a) {
            null != a.ti && (g.x.clearTimeout(a.ti),
                a.ti = null)
        }
            , sEa = function(a, b) {
            var c = 5E3 + Math.floor(1E4 * Math.random());
            a.isActive() || (c *= 2);
            return c * b
        }
            , e7 = function(a, b) {
            if (2 == b || 9 == b) {
                var c = null;
                a.ud && (c = null);
                var d = (0,
                    g.A)(a.XW, a);
                c || (c = new g.Hm("//www.google.com/images/cleardot.gif"),
                    m6(c));
                cEa(c.toString(), 1E4, d)
            } else
                O6(2);
            tEa(a, b)
        }
            , tEa = function(a, b) {
            a.o = 0;
            a.ud && a.ud.By(b);
            lEa(a);
            kEa(a)
        }
            , lEa = function(a) {
            a.o = 0;
            a.Wf = -1;
            if (a.ud)
                if (0 == a.C.length && 0 == a.A.length)
                    a.ud.Xr();
                else {
                    g.Wa(a.C);
                    var b = g.Wa(a.A);
                    a.C.length = 0;
                    a.A.length = 0;
                    a.ud.Xr(b)
                }
        }
            , W6 = function(a, b, c) {
            var d = g.Rm(c);
            if ("" != d.A)
                b && g.Jm(d, b + "." + d.A),
                    g.Km(d, d.D);
            else {
                var e = window.location;
                d = tDa(e.protocol, b ? b + "." + e.hostname : e.hostname, +e.port, c)
            }
            a.Il && g.Lb(a.Il, function(a, b) {
                g.Qm(d, b, a)
            });
            g.Qm(d, "VER", a.si);
            $6(a, d);
            return d
        }
            , T6 = function(a, b) {
            if (!g.Ba(a))
                throw Error("Fn must not be null and must be a function");
            return g.x.setTimeout(function() {
                a()
            }, b)
        }
            , O6 = function(a) {
            f7.dispatchEvent(new hEa(f7,a))
        }
            , uEa = function() {}
            , vEa = function(a, b) {
            this.action = a;
            this.params = b || {}
        }
            , g7 = function(a, b) {
            g.M.call(this);
            this.o = new g.nu(this.ZU,0,this);
            g.N(this, this.o);
            this.wd = 5E3;
            this.A = 0;
            if (g.Ba(a))
                b && (a = (0,
                    g.A)(a, b));
            else if (a && g.Ba(a.handleEvent))
                a = (0,
                    g.A)(a.handleEvent, a);
            else
                throw Error("Invalid listener argument");
            this.B = a
        }
            , h7 = function(a, b, c) {
            this.L = a;
            this.F = b;
            this.B = new g.mD;
            this.A = new g7(this.HX,this);
            this.o = this.fb = null;
            this.K = !1;
            this.D = null;
            this.J = "";
            this.H = this.C = 0;
            this.G = [];
            this.M = c || !1
        }
            , wEa = function(a) {
            return {
                firstTestResults: [""],
                secondTestResults: !a.o.Vq,
                sessionId: a.o.B,
                arrayId: a.o.nk
            }
        }
            , xEa = function(a, b) {
            a.H = b || 0;
            a.A.stop();
            a.o && (3 == a.o.o && qEa(a.o),
                mEa(a.o));
            a.H = 0
        }
            , i7 = function(a) {
            return !!a.o && 3 == a.o.o
        }
            , yEa = function(a, b) {
            (a.F.loungeIdToken = b) || a.A.stop()
        }
            , j7 = function(a) {
            this.port = this.domain = "";
            this.o = "/api/lounge";
            this.A = !0;
            a = a || window.document.location.href;
            var b = g.Sg(a) || "";
            b && (this.port = ":" + b);
            this.domain = g.Rg(a) || "";
            a = g.Ib;
            0 <= a.search("MSIE") && (a = a.match(/MSIE ([\d.]+)/)[1],
            0 > g.Bb(a, "10.0") && (this.A = !1))
        }
            , k7 = function(a, b) {
            var c = a.o;
            if (g.u(void 0) ? 0 : a.A)
                c = "https://" + a.domain + a.port + a.o;
            return g.ch(c + b, {})
        }
            , l7 = function(a, b, c, d, e) {
            a = {
                format: "JSON",
                method: "POST",
                context: a,
                timeout: 5E3,
                withCredentials: !1,
                onSuccess: g.Fa(a.C, d, !0),
                onError: g.Fa(a.B, e),
                Bd: g.Fa(a.D, e)
            };
            c && (a.Pb = c,
                a.headers = {
                    "Content-Type": "application/x-www-form-urlencoded"
                });
            return g.DE(b, a)
        }
            , CEa = function() {
            var a = zEa;
            AEa();
            m7.push(a);
            BEa(m7)
        }
            , n7 = function(a, b) {
            AEa();
            var c = m7
                , d = DEa(a, String(b));
            g.Pa(c) ? EEa(d) : (BEa(c),
                (0,
                    g.C)(c, function(a) {
                    a(d)
                }))
        }
            , AEa = function() {
            m7 || (m7 = g.y("yt.mdx.remote.debug.handlers_") || [],
                g.ua("yt.mdx.remote.debug.handlers_", m7, void 0))
        }
            , EEa = function(a) {
            var b = (o7 + 1) % 50;
            o7 = b;
            p7[b] = a;
            q7 || (q7 = 49 == b)
        }
            , BEa = function(a) {
            var b = p7;
            if (b[0]) {
                var c = o7
                    , d = q7 ? c : -1;
                do {
                    d = (d + 1) % 50;
                    var e = b[d];
                    (0,
                        g.C)(a, function(a) {
                        a(e)
                    })
                } while (d != c);p7 = Array(50);
                o7 = -1;
                q7 = !1
            }
        }
            , DEa = function(a, b) {
            var c = ((0,
                g.G)() - FEa) / 1E3;
            c.toFixed && (c = c.toFixed(3));
            var d = [];
            d.push("[", c + "s", "] ");
            d.push("[", "yt.mdx.remote", "] ");
            d.push(a + ": " + b, "\n");
            return d.join("")
        }
            , r7 = function(a) {
            g.XF.call(this);
            this.G = a;
            this.o = []
        }
            , GEa = function(a, b) {
            var c = a.get(b.uuid) || a.get(b.id);
            if (c) {
                var d = c.name;
                c.id = b.id || c.id;
                c.name = b.name;
                c.token = b.token;
                c.uuid = b.uuid || c.uuid;
                return c.name != d
            }
            a.o.push(b);
            return !0
        }
            , HEa = function(a, b) {
            var c = a.o.length != b.length;
            a.o = (0,
                g.Td)(a.o, function(a) {
                return !!u6(b, a)
            });
            for (var d = 0, e = b.length; d < e; d++)
                c = GEa(a, b[d]) || c;
            return c
        }
            , IEa = function(a, b) {
            var c = a.o.length;
            a.o = (0,
                g.Td)(a.o, function(a) {
                return !(a || b ? !a != !b ? 0 : a.id == b.id : 1)
            });
            return a.o.length < c
        }
            , s7 = function(a, b, c, d) {
            g.XF.call(this);
            this.F = a;
            this.D = b;
            this.B = c;
            this.C = d;
            this.A = 0;
            this.o = null;
            this.Fa = window.NaN
        }
            , u7 = function(a) {
            r7.call(this, "LocalScreenService");
            this.B = a;
            this.A = window.NaN;
            t7(this);
            this.info("Initializing with " + s6(this.o))
        }
            , JEa = function(a) {
            if (a.o.length) {
                var b = (0,
                    g.I)(a.o, function(a) {
                    return a.id
                })
                    , c = k7(a.B, "/pairing/get_lounge_token_batch");
                l7(a.B, c, {
                    screen_ids: b.join(",")
                }, (0,
                    g.A)(a.QK, a), (0,
                    g.A)(a.PK, a))
            }
        }
            , t7 = function(a) {
            var b = BDa(HDa());
            b = (0,
                g.Td)(b, function(a) {
                return !a.uuid
            });
            return HEa(a, b)
        }
            , v7 = function(a, b) {
            JDa((0,
                g.I)(a.o, zDa));
            b && IDa()
        }
            , x7 = function(a, b) {
            g.XF.call(this);
            this.F = b;
            var c = g.gH("yt-remote-online-screen-ids") || "";
            c = c ? c.split(",") : [];
            for (var d = {}, e = this.F(), f = 0, k = e.length; f < k; ++f) {
                var l = e[f].id;
                d[l] = g.Oa(c, l)
            }
            this.o = d;
            this.D = a;
            this.B = this.C = window.NaN;
            this.A = null;
            w7("Initialized with " + g.Jg(this.o))
        }
            , KEa = function(a, b, c) {
            var d = k7(a.D, "/pairing/get_screen_availability");
            l7(a.D, d, {
                lounge_token: b.token
            }, (0,
                g.A)(function(a) {
                a = a.screens || [];
                for (var d = 0, e = a.length; d < e; ++d)
                    if (a[d].loungeToken == b.token) {
                        c("online" == a[d].status);
                        return
                    }
                c(!1)
            }, a), (0,
                g.A)(function() {
                c(!1)
            }, a))
        }
            , y7 = function(a, b) {
            a: if (g.Pb(b) != g.Pb(a.o))
                var c = !1;
            else {
                c = g.Tb(b);
                for (var d = 0, e = c.length; d < e; ++d)
                    if (!a.o[c[d]]) {
                        c = !1;
                        break a
                    }
                c = !0
            }
            c || (w7("Updated online screens: " + g.Jg(a.o)),
                a.o = b,
                a.V("screenChange"));
            LEa(a)
        }
            , z7 = function(a) {
            (0,
                window.isNaN)(a.B) || g.oE(a.B);
            a.B = g.mE((0,
                g.A)(a.Tv, a), 0 < a.C && a.C < (0,
                g.G)() ? 2E4 : 1E4)
        }
            , w7 = function(a) {
            n7("OnlineScreenService", a)
        }
            , MEa = function(a) {
            var b = {};
            (0,
                g.C)(a.F(), function(a) {
                a.token ? b[a.token] = a.id : this.hc("Requesting availability of screen w/o lounge token.")
            });
            return b
        }
            , LEa = function(a) {
            a = g.Tb(g.Mb(a.o, function(a) {
                return a
            }));
            g.fb(a);
            a.length ? g.fH("yt-remote-online-screen-ids", a.join(","), 60) : g.hH("yt-remote-online-screen-ids")
        }
            , A7 = function(a) {
            r7.call(this, "ScreenService");
            this.F = a;
            this.A = this.B = null;
            this.C = [];
            this.D = {};
            NEa(this)
        }
            , PEa = function(a, b, c, d, e, f) {
            a.info("getAutomaticScreenByIds " + c + " / " + b);
            c || (c = a.D[b]);
            var k = a.te();
            if (k = (c ? v6(k, c) : null) || v6(k, b)) {
                k.uuid = b;
                var l = B7(a, k);
                KEa(a.A, l, function(a) {
                    e(a ? l : null)
                })
            } else
                c ? OEa(a, c, (0,
                    g.A)(function(a) {
                    var f = B7(this, new p6({
                        name: d,
                        screenId: c,
                        loungeToken: a,
                        dialId: b || ""
                    }));
                    KEa(this.A, f, function(a) {
                        e(a ? f : null)
                    })
                }, a), f) : e(null)
        }
            , QEa = function(a, b) {
            for (var c = 0, d = a.o.length; c < d; ++c)
                if (a.o[c].name == b)
                    return a.o[c];
            return null
        }
            , OEa = function(a, b, c, d) {
            a.info("requestLoungeToken_ for " + b);
            var e = {
                Pb: {
                    screen_ids: b
                },
                method: "POST",
                context: a,
                onSuccess: function(a, e) {
                    var f = e && e.screens || [];
                    f[0] && f[0].screenId == b ? c(f[0].loungeToken) : d(Error("Missing lounge token in token response"))
                },
                onError: function() {
                    d(Error("Request screen lounge token failed"))
                }
            };
            g.DE(k7(a.F, "/pairing/get_lounge_token_batch"), e)
        }
            , REa = function(a) {
            a.o = a.B.te();
            var b = a.D, c = {}, d;
            for (d in b)
                c[b[d]] = d;
            b = 0;
            for (d = a.o.length; b < d; ++b) {
                var e = a.o[b];
                e.uuid = c[e.id] || ""
            }
            a.info("Updated manual screens: " + s6(a.o))
        }
            , NEa = function(a) {
            C7(a);
            a.B = new u7(a.F);
            a.B.subscribe("screenChange", (0,
                g.A)(a.fL, a));
            REa(a);
            a.C = BDa(g.gH("yt-remote-automatic-screen-cache") || []);
            C7(a);
            a.info("Initializing automatic screens: " + s6(a.C));
            a.A = new x7(a.F,(0,
                g.A)(a.te, a, !0));
            a.A.subscribe("screenChange", (0,
                g.A)(function() {
                this.V("onlineScreenChange")
            }, a))
        }
            , B7 = function(a, b) {
            var c = a.get(b.id);
            c ? (c.uuid = b.uuid,
                b = c) : ((c = v6(a.C, b.uuid)) ? (c.id = b.id,
                c.token = b.token,
                b = c) : a.C.push(b),
                g.fH("yt-remote-automatic-screen-cache", (0,
                    g.I)(a.C, zDa)));
            C7(a);
            a.D[b.uuid] = b.id;
            g.fH("yt-remote-device-id-map", a.D, 31536E3);
            return b
        }
            , C7 = function(a) {
            a.D = g.gH("yt-remote-device-id-map") || {}
        }
            , D7 = function(a, b, c) {
            g.XF.call(this);
            this.M = c;
            this.J = a;
            this.A = b;
            this.B = null
        }
            , E7 = function(a, b) {
            n7(a.M, b)
        }
            , F7 = function(a, b) {
            D7.call(this, a, b, "CastSession");
            this.o = null;
            this.C = 0;
            this.F = (0,
                g.A)(this.NX, this);
            this.D = (0,
                g.A)(this.LV, this);
            this.C = g.mE((0,
                g.A)(function() {
                SEa(this, null)
            }, this), 12E4)
        }
            , TEa = function(a) {
            a.info("sendYoutubeMessage_: getMdxSessionStatus " + g.Jg(void 0));
            var b = {
                type: "getMdxSessionStatus"
            };
            a.o ? a.o.sendMessage("urn:x-cast:com.google.youtube.mdx", b, g.z, (0,
                g.A)(function() {
                E7(this, "Failed to send message: getMdxSessionStatus.")
            }, a)) : E7(a, "Sending yt message without session: " + g.Jg(b))
        }
            , SEa = function(a, b) {
            g.oE(a.C);
            if (b) {
                if (a.info("onConnectedScreenId_: Received screenId: " + b),
                !a.B || a.B.id != b) {
                    var c = (0,
                        g.A)(a.Tp, a)
                        , d = (0,
                        g.A)(a.ze, a);
                    a.Pz(b, c, d, 5)
                }
            } else
                a.ze(Error("Waiting for session status timed out."))
        }
            , G7 = function(a, b, c) {
            D7.call(this, a, b, "DialSession");
            this.C = this.H = null;
            this.K = "";
            this.O = c;
            this.D = null;
            this.G = g.z;
            this.F = window.NaN;
            this.L = (0,
                g.A)(this.QX, this);
            this.o = g.z
        }
            , UEa = function(a) {
            a.o = a.J.iG(a.K, a.A.label, a.A.friendlyName, (0,
                g.A)(function(a) {
                this.o = g.z;
                this.Tp(a)
            }, a), (0,
                g.A)(function(a) {
                this.o = g.z;
                this.ze(a)
            }, a))
        }
            , VEa = function(a) {
            var b = {};
            b.pairingCode = a.K;
            b.theme = a.O;
            if (a.D) {
                var c = a.D.currentTime || 0;
                b.v = a.D.videoId;
                b.t = c
            }
            LDa() && (b.env_useStageMdx = 1);
            return g.ah(b)
        }
            , H7 = function(a, b) {
            D7.call(this, a, b, "ManualSession");
            this.o = g.mE((0,
                g.A)(this.qk, this, null), 150)
        }
            , I7 = function(a, b, c, d) {
            g.XF.call(this);
            this.A = a;
            this.G = b || "233637DE";
            this.F = c || "cl";
            this.H = d || !1;
            this.o = null;
            this.D = !1;
            this.B = [];
            this.C = (0,
                g.A)(this.mU, this)
        }
            , WEa = function(a, b) {
            return b ? g.Ka(a.B, function(a) {
                return q6(b, a.label)
            }, a) : null
        }
            , J7 = function(a) {
            n7("Controller", a)
        }
            , zEa = function(a) {
            window.chrome && window.chrome.cast && window.chrome.cast.logMessage && window.chrome.cast.logMessage(a)
        }
            , K7 = function(a) {
            return a.D || !!a.B.length || !!a.o
        }
            , L7 = function(a, b, c) {
            b != a.o && (g.kf(a.o),
                (a.o = b) ? (c ? a.V("yt-remote-cast2-receiver-resumed", b.A) : a.V("yt-remote-cast2-receiver-selected", b.A),
                    b.subscribe("sessionScreen", (0,
                        g.A)(a.PD, a, b)),
                    b.B ? a.V("yt-remote-cast2-session-change", b.B) : c && a.o.qk(null)) : a.V("yt-remote-cast2-session-change", null))
        }
            , XEa = function(a) {
            var b = a.A.hG()
                , c = a.o && a.o.A;
            a = (0,
                g.I)(b, function(a) {
                c && q6(a, c.label) && (c = null);
                var b = a.uuid ? a.uuid : a.id
                    , d = WEa(this, a);
                d ? (d.label = b,
                    d.friendlyName = a.name) : (d = new window.chrome.cast.Receiver(b,a.name),
                    d.receiverType = window.chrome.cast.ReceiverType.CUSTOM);
                return d
            }, a);
            c && (c.receiverType != window.chrome.cast.ReceiverType.CUSTOM && (c = new window.chrome.cast.Receiver(c.label,c.friendlyName),
                c.receiverType = window.chrome.cast.ReceiverType.CUSTOM),
                a.push(c));
            return a
        }
            , cFa = function(a, b, c, d, e, f, k) {
            YEa() ? ZEa(b, e, f, k) && (N7(!0),
                window.chrome && window.chrome.cast && window.chrome.cast.isAvailable ? $Ea(a, c) : (window.__onGCastApiAvailable = function(b, d) {
                    b ? $Ea(a, c) : (O7("Failed to load cast API: " + d),
                        P7(!1),
                        N7(!1),
                        g.hH("yt-remote-cast-available"),
                        g.hH("yt-remote-cast-receiver"),
                        aFa(),
                        c(!1))
                }
                    ,
                    d ? window.spf ? window.spf.script.load("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js", "", void 0) : ODa() : G6("CriOS") ? TDa() : G6("Android") && G6("Chrome/") && window.navigator.presentation ? UDa() : window.chrome && window.navigator.presentation && !G6("Edge") ? (H6(),
                        D6(bFa.map(RDa))) : E6())) : M7("Cannot initialize because not running Chrome")
        }
            , aFa = function() {
            M7("dispose");
            var a = Q7();
            a && a.dispose();
            g.ua("yt.mdx.remote.cloudview.instance_", null, void 0);
            dFa(!1);
            g.jG(R7);
            R7.length = 0
        }
            , S7 = function() {
            return !!g.gH("yt-remote-cast-installed")
        }
            , eFa = function() {
            var a = g.gH("yt-remote-cast-receiver");
            return a ? a.friendlyName : null
        }
            , fFa = function() {
            M7("clearCurrentReceiver");
            g.hH("yt-remote-cast-receiver")
        }
            , gFa = function() {
            return S7() ? Q7() ? Q7().getCastSession() : (O7("getCastSelector: Cast is not initialized."),
                null) : (O7("getCastSelector: Cast API is not installed!"),
                null)
        }
            , U7 = function() {
            S7() ? Q7() ? T7() ? (M7("Requesting cast selector."),
                Q7().requestSession()) : (M7("Wait for cast API to be ready to request the session."),
                R7.push(g.iG("yt-remote-cast2-api-ready", U7))) : O7("requestCastSelector: Cast is not initialized.") : O7("requestCastSelector: Cast API is not installed!")
        }
            , V7 = function(a, b) {
            T7() ? Q7().setConnectedScreenStatus(a, b) : O7("setConnectedScreenStatus called before ready.")
        }
            , YEa = function() {
            var a = 0 <= g.Ib.search(/ (CrMo|Chrome|CriOS)\//);
            return g.FJ || a
        }
            , hFa = function(a, b) {
            Q7().init(a, b)
        }
            , ZEa = function(a, b, c, d) {
            var e = !1;
            Q7() || (a = new I7(a,b,c,d),
                a.subscribe("yt-remote-cast2-availability-change", function(a) {
                    g.fH("yt-remote-cast-available", a);
                    g.mG("yt-remote-cast2-availability-change", a)
                }),
                a.subscribe("yt-remote-cast2-receiver-selected", function(a) {
                    M7("onReceiverSelected: " + a.friendlyName);
                    g.fH("yt-remote-cast-receiver", a);
                    g.mG("yt-remote-cast2-receiver-selected", a)
                }),
                a.subscribe("yt-remote-cast2-receiver-resumed", function(a) {
                    M7("onReceiverResumed: " + a.friendlyName);
                    g.fH("yt-remote-cast-receiver", a)
                }),
                a.subscribe("yt-remote-cast2-session-change", function(a) {
                    M7("onSessionChange: " + r6(a));
                    a || g.hH("yt-remote-cast-receiver");
                    g.mG("yt-remote-cast2-session-change", a)
                }),
                g.ua("yt.mdx.remote.cloudview.instance_", a, void 0),
                e = !0);
            M7("cloudview.createSingleton_: " + e);
            return e
        }
            , Q7 = function() {
            return g.y("yt.mdx.remote.cloudview.instance_")
        }
            , $Ea = function(a, b) {
            P7(!0);
            N7(!1);
            hFa(a, function(a) {
                a ? (dFa(!0),
                    g.lG("yt-remote-cast2-api-ready")) : (O7("Failed to initialize cast API."),
                    P7(!1),
                    g.hH("yt-remote-cast-available"),
                    g.hH("yt-remote-cast-receiver"),
                    aFa());
                b(a)
            })
        }
            , M7 = function(a) {
            n7("cloudview", a)
        }
            , O7 = function(a) {
            n7("cloudview", a)
        }
            , P7 = function(a) {
            M7("setCastInstalled_ " + a);
            g.fH("yt-remote-cast-installed", a)
        }
            , T7 = function() {
            return !!g.y("yt.mdx.remote.cloudview.apiReady_")
        }
            , dFa = function(a) {
            M7("setApiReady_ " + a);
            g.ua("yt.mdx.remote.cloudview.apiReady_", a, void 0)
        }
            , N7 = function(a) {
            g.ua("yt.mdx.remote.cloudview.initializing_", a, void 0)
        }
            , W7 = function(a) {
            this.index = -1;
            this.videoId = this.listId = "";
            this.volume = this.o = -1;
            this.muted = !1;
            this.audioTrackId = null;
            this.G = this.H = 0;
            this.A = null;
            this.hasNext = this.ag = !1;
            this.K = this.J = this.B = this.D = 0;
            this.C = window.NaN;
            this.F = !1;
            this.reset(a)
        }
            , X7 = function(a) {
            a.audioTrackId = null;
            a.A = null;
            a.o = -1;
            a.ag = !1;
            a.hasNext = !1;
            a.H = 0;
            a.G = (0,
                g.G)();
            a.D = 0;
            a.B = 0;
            a.J = 0;
            a.K = 0;
            a.C = window.NaN;
            a.F = !1
        }
            , Y7 = function(a) {
            return a.qb() ? ((0,
                g.G)() - a.G) / 1E3 : 0
        }
            , Z7 = function(a, b) {
            a.H = b;
            a.G = (0,
                g.G)()
        }
            , $7 = function(a) {
            switch (a.o) {
                case 1:
                case 1081:
                    return ((0,
                        g.G)() - a.G) / 1E3 + a.H;
                case -1E3:
                    return 0
            }
            return a.H
        }
            , a8 = function(a, b, c) {
            var d = a.videoId;
            a.videoId = b;
            a.index = c;
            b != d && X7(a)
        }
            , b8 = function(a) {
            var b = {};
            b.index = a.index;
            b.listId = a.listId;
            b.videoId = a.videoId;
            b.playerState = a.o;
            b.volume = a.volume;
            b.muted = a.muted;
            b.audioTrackId = a.audioTrackId;
            b.trackData = g.fc(a.A);
            b.hasPrevious = a.ag;
            b.hasNext = a.hasNext;
            b.playerTime = a.H;
            b.playerTimeAt = a.G;
            b.seekableStart = a.D;
            b.seekableEnd = a.B;
            b.duration = a.J;
            b.loadedTime = a.K;
            b.liveIngestionTime = a.C;
            return b
        }
            , d8 = function(a, b) {
            g.XF.call(this);
            this.o = 0;
            this.C = a;
            this.F = [];
            this.D = new g.DC;
            this.B = this.A = null;
            this.J = (0,
                g.A)(this.FR, this);
            this.G = (0,
                g.A)(this.Lm, this);
            this.H = (0,
                g.A)(this.ER, this);
            this.K = (0,
                g.A)(this.RR, this);
            var c = 0;
            a ? (c = a.getProxyState(),
            3 != c && (a.subscribe("proxyStateChange", this.Pw, this),
                iFa(this))) : c = 3;
            0 != c && (b ? this.Pw(c) : g.mE((0,
                g.A)(function() {
                this.Pw(c)
            }, this), 0));
            var d = gFa();
            d && c8(this, d);
            this.subscribe("yt-remote-cast2-session-change", this.K)
        }
            , e8 = function(a) {
            return new W7(a.C.getPlayerContextData())
        }
            , iFa = function(a) {
            (0,
                g.C)("nowAutoplaying autoplayDismissed remotePlayerChange remoteQueueChange autoplayModeChange autoplayUpNext previousNextChange".split(" "), function(a) {
                this.F.push(this.C.subscribe(a, g.Fa(this.hU, a), this))
            }, a)
        }
            , jFa = function(a) {
            (0,
                g.C)(a.F, function(a) {
                this.C.unsubscribeByKey(a)
            }, a);
            a.F.length = 0
        }
            , f8 = function(a, b) {
            50 > a.D.xc() && g.FC(a.D, b)
        }
            , h8 = function(a, b, c) {
            var d = e8(a);
            Z7(d, c);
            -1E3 != d.o && (d.o = b);
            g8(a, d)
        }
            , i8 = function(a, b, c) {
            a.C.sendMessage(b, c)
        }
            , g8 = function(a, b) {
            jFa(a);
            a.C.setPlayerContextData(b8(b));
            iFa(a)
        }
            , c8 = function(a, b) {
            a.B && (a.B.removeUpdateListener(a.J),
                a.B.removeMediaListener(a.G),
                a.Lm(null));
            a.B = b;
            a.B && (n7("CP", "Setting cast session: " + a.B.sessionId),
                a.B.addUpdateListener(a.J),
                a.B.addMediaListener(a.G),
            a.B.media.length && a.Lm(a.B.media[0]))
        }
            , kFa = function(a) {
            var b = a.A.media
                , c = a.A.customData;
            if (b && c) {
                var d = e8(a);
                b.contentId != d.videoId && n7("CP", "Cast changing video to: " + b.contentId);
                d.videoId = b.contentId;
                d.o = c.playerState;
                Z7(d, a.A.getEstimatedTime());
                g8(a, d)
            } else
                n7("CP", "No cast media video. Ignoring state update.")
        }
            , j8 = function(a, b, c) {
            return (0,
                g.A)(function(a) {
                this.hc("Failed to " + b + " with cast v2 channel. Error code: " + a.code);
                a.code != window.chrome.cast.ErrorCode.TIMEOUT && (this.hc("Retrying " + b + " using MDx browser channel."),
                    i8(this, b, c))
            }, a)
        }
            , k8 = function(a, b, c) {
            g.XF.call(this);
            this.D = window.NaN;
            this.O = !1;
            this.K = this.J = this.L = this.M = window.NaN;
            this.T = [];
            this.C = this.G = this.B = this.gb = this.o = null;
            this.sa = a;
            this.T.push(g.GF(window, "beforeunload", (0,
                g.A)(this.HK, this)));
            this.A = [];
            this.gb = new W7;
            this.ba = b.id;
            this.o = lFa(this, c);
            this.o.subscribe("handlerOpened", this.JR, this);
            this.o.subscribe("handlerClosed", this.GR, this);
            this.o.subscribe("handlerError", this.HR, this);
            this.o.subscribe("handlerMessage", this.IR, this);
            yEa(this.o, b.token);
            this.subscribe("remoteQueueChange", function() {
                var a = this.gb.videoId;
                g.iH() && g.fH("yt-remote-session-video-id", a)
            }, this)
        }
            , l8 = function(a) {
            n7("conn", a)
        }
            , lFa = function(a, b) {
            return new h7(k7(a.sa, "/bc"),b)
        }
            , m8 = function(a, b) {
            a.V("proxyStateChange", b)
        }
            , mFa = function(a) {
            a.D = g.mE((0,
                g.A)(function() {
                l8("Connecting timeout");
                this.F(1)
            }, a), 2E4)
        }
            , n8 = function(a) {
            g.oE(a.D);
            a.D = window.NaN
        }
            , o8 = function(a) {
            g.oE(a.M);
            a.M = window.NaN
        }
            , nFa = function(a) {
            p8(a);
            a.L = g.mE((0,
                g.A)(function() {
                q8(this, "getNowPlaying")
            }, a), 2E4)
        }
            , p8 = function(a) {
            g.oE(a.L);
            a.L = window.NaN
        }
            , pFa = function(a, b) {
            b && (n8(a),
                o8(a));
            b == (i7(a.o) && (0,
                window.isNaN)(a.D)) ? b && (m8(a, 1),
                q8(a, "getSubtitlesTrack")) : b ? (a.Z() && a.gb.reset(),
                m8(a, 1),
                q8(a, "getNowPlaying"),
                oFa(a)) : a.F(1)
        }
            , qFa = function(a, b) {
            var c = b.params.videoId;
            delete b.params.videoId;
            c == a.gb.videoId && (g.Zb(b.params) ? a.gb.A = null : a.gb.A = b.params,
                a.V("remotePlayerChange"))
        }
            , rFa = function(a, b) {
            var c = b.params.videoId || b.params.video_id
                , d = (0,
                window.parseInt)(b.params.currentIndex, 10);
            a.gb.listId = b.params.listId || a.gb.listId;
            a8(a.gb, c, d);
            a.V("remoteQueueChange")
        }
            , tFa = function(a, b) {
            b.params = b.params || {};
            rFa(a, b);
            sFa(a, b);
            a.V("autoplayDismissed")
        }
            , sFa = function(a, b) {
            var c = (0,
                window.parseInt)(b.params.currentTime || b.params.current_time, 10);
            Z7(a.gb, (0,
                window.isNaN)(c) ? 0 : c);
            c = (0,
                window.parseInt)(b.params.state, 10);
            c = (0,
                window.isNaN)(c) ? -1 : c;
            -1 == c && -1E3 == a.gb.o && (c = -1E3);
            a.gb.o = c;
            c = Number(b.params.loadedTime);
            a.gb.K = (0,
                window.isNaN)(c) ? 0 : c;
            c = Number(b.params.duration);
            a.gb.J = (0,
                window.isNaN)(c) ? 0 : c;
            c = a.gb;
            var d = Number(b.params.liveIngestionTime);
            c.C = d;
            c.F = (0,
                window.isNaN)(d) ? !1 : !0;
            c = a.gb;
            d = Number(b.params.seekableStartTime);
            var e = Number(b.params.seekableEndTime);
            c.D = (0,
                window.isNaN)(d) ? 0 : d;
            c.B = (0,
                window.isNaN)(e) ? 0 : e;
            1 == a.gb.o ? nFa(a) : p8(a);
            a.V("remotePlayerChange")
        }
            , uFa = function(a, b) {
            if (-1E3 != a.gb.o) {
                var c = 1085;
                switch ((0,
                    window.parseInt)(b.params.adState, 10)) {
                    case 1:
                        c = 1081;
                        break;
                    case 2:
                        c = 1084;
                        break;
                    case 0:
                        c = 1083
                }
                a.gb.o = c;
                c = (0,
                    window.parseInt)(b.params.currentTime, 10);
                Z7(a.gb, (0,
                    window.isNaN)(c) ? 0 : c);
                a.V("remotePlayerChange")
            }
        }
            , vFa = function(a, b) {
            var c = "true" == b.params.muted;
            a.gb.volume = (0,
                window.parseInt)(b.params.volume, 10);
            a.gb.muted = c;
            a.V("remotePlayerChange")
        }
            , wFa = function(a, b) {
            a.G = b.params.videoId;
            a.V("nowAutoplaying", (0,
                window.parseInt)(b.params.timeout, 10))
        }
            , xFa = function(a, b) {
            var c = "true" == b.params.hasNext;
            a.gb.ag = "true" == b.params.hasPrevious;
            a.gb.hasNext = c;
            a.V("previousNextChange")
        }
            , oFa = function(a) {
            g.oE(a.K);
            a.K = g.mE((0,
                g.A)(a.F, a, 1), 864E5)
        }
            , q8 = function(a, b, c) {
            c ? l8("Sending: action=" + b + ", params=" + g.Jg(c)) : l8("Sending: action=" + b);
            a.o.sendMessage(b, c)
        }
            , r8 = function(a) {
            r7.call(this, "ScreenServiceProxy");
            this.hd = a;
            this.A = [];
            this.A.push(this.hd.$_s("screenChange", (0,
                g.A)(this.LX, this)));
            this.A.push(this.hd.$_s("onlineScreenChange", (0,
                g.A)(this.GT, this)))
        }
            , CFa = function(a) {
            var b = {
                device: "Desktop",
                app: "youtube-desktop"
            };
            b = g.gE("MDX_CONFIG") || b;
            DDa();
            z6();
            s8 || (s8 = new j7(b ? b.loungeApiHost : void 0),
            LDa() && (s8.o = "/api/loungedev"));
            t8 || (t8 = g.y("yt.mdx.remote.deferredProxies_") || [],
                g.ua("yt.mdx.remote.deferredProxies_", t8, void 0));
            yFa();
            var c = u8();
            if (!c) {
                var d = new A7(s8);
                g.ua("yt.mdx.remote.screenService_", d, void 0);
                c = u8();
                var e = !1
                    , f = void 0
                    , k = void 0
                    , l = !1;
                b && (e = !!b.loadCastApiSetupScript,
                    f = b.appId,
                    k = b.theme,
                    l = !!b.disableDial);
                cFa(a, d, function(a) {
                    a ? v8() && V7(v8(), "YouTube TV") : d.subscribe("onlineScreenChange", function() {
                        g.mG("yt-remote-receiver-availability-change")
                    })
                }, e, f, k, l)
            }
            b && !g.y("yt.mdx.remote.initialized_") && (g.ua("yt.mdx.remote.initialized_", !0, void 0),
                w8("Initializing: " + g.Jg(b)),
                x8.push(g.iG("yt-remote-cast2-availability-change", function() {
                    g.mG("yt-remote-receiver-availability-change")
                })),
                x8.push(g.iG("yt-remote-cast2-receiver-selected", function() {
                    y8(null);
                    g.mG("yt-remote-auto-connect", "cast-selector-receiver")
                })),
                x8.push(g.iG("yt-remote-cast2-receiver-resumed", function() {
                    g.mG("yt-remote-receiver-resumed", "cast-selector-receiver")
                })),
                x8.push(g.iG("yt-remote-cast2-session-change", zFa)),
                x8.push(g.iG("yt-remote-connection-change", function(a) {
                    a ? V7(v8(), "YouTube TV") : z8() || (V7(null, null),
                        fFa())
                })),
                a = A8(),
            b.isAuto && (a.id += "#dial"),
            g.cG("desktop_enable_autoplay") && (a.capabilities = ["atp"]),
                a.name = b.device,
                a.app = b.app,
            (k = b.theme) && (a.theme = k),
                w8(" -- with channel params: " + g.Jg(a)),
                AFa(a),
                c.start(),
            v8() || BFa())
        }
            , EFa = function() {
            var a = DFa();
            S7() && g.gH("yt-remote-cast-available") && a.push({
                key: "cast-selector-receiver",
                name: "Cast..."
            });
            return a
        }
            , DFa = function() {
            var a = u8().hd.$_gos();
            var b = B8();
            b && C8() && (u6(a, b) || a.push(b));
            return CDa(a)
        }
            , D8 = function() {
            var a = FFa();
            !a && S7() && eFa() && (a = {
                key: "cast-selector-receiver",
                name: eFa()
            });
            return a
        }
            , FFa = function() {
            var a = DFa()
                , b = B8();
            b || (b = z8());
            return g.Ka(a, function(a) {
                return b && q6(b, a.key) ? !0 : !1
            })
        }
            , B8 = function() {
            var a = v8();
            if (!a)
                return null;
            var b = u8().te();
            return v6(b, a)
        }
            , zFa = function(a) {
            w8("remote.onCastSessionChange_: " + r6(a));
            if (a) {
                var b = B8();
                b && b.id == a.id ? V7(b.id, "YouTube TV") : (b && E8(),
                    F8(a, 1))
            } else
                C8() && E8()
        }
            , E8 = function() {
            T7() ? Q7().stopSession() : O7("stopSession called before API ready.");
            var a = C8();
            a && (a.disconnect(1),
                G8(null))
        }
            , H8 = function() {
            var a = C8();
            return !!a && 3 != a.getProxyState()
        }
            , w8 = function(a) {
            n7("remote", a)
        }
            , u8 = function() {
            if (!I8) {
                var a = g.y("yt.mdx.remote.screenService_");
                I8 = a ? new r8(a) : null
            }
            return I8
        }
            , v8 = function() {
            return g.y("yt.mdx.remote.currentScreenId_")
        }
            , GFa = function(a) {
            g.ua("yt.mdx.remote.currentScreenId_", a, void 0)
        }
            , HFa = function() {
            return g.y("yt.mdx.remote.connectData_")
        }
            , y8 = function(a) {
            g.ua("yt.mdx.remote.connectData_", a, void 0)
        }
            , C8 = function() {
            return g.y("yt.mdx.remote.connection_")
        }
            , G8 = function(a) {
            var b = C8();
            y8(null);
            a || GFa("");
            g.ua("yt.mdx.remote.connection_", a, void 0);
            t8 && ((0,
                g.C)(t8, function(b) {
                b(a)
            }),
                t8.length = 0);
            b && !a ? g.mG("yt-remote-connection-change", !1) : !b && a && g.mG("yt-remote-connection-change", !0)
        }
            , z8 = function() {
            var a = g.iH();
            if (!a)
                return null;
            var b = u8().te();
            return v6(b, a)
        }
            , F8 = function(a, b) {
            B8() && B8();
            GFa(a.id);
            var c = new k8(s8,a,A8());
            c.connect(b, HFa());
            c.subscribe("beforeDisconnect", function(a) {
                g.mG("yt-remote-before-disconnect", a)
            });
            c.subscribe("beforeDispose", function() {
                C8() && G8(null)
            });
            G8(c)
        }
            , BFa = function() {
            var a = z8();
            a ? (w8("Resume connection to: " + r6(a)),
                F8(a, 0)) : (A6(),
                fFa(),
                w8("Skipping connecting because no session screen found."))
        }
            , yFa = function() {
            var a = A8();
            if (g.Zb(a)) {
                a = y6();
                var b = g.gH("yt-remote-session-name") || ""
                    , c = g.gH("yt-remote-session-app") || "";
                a = {
                    device: "REMOTE_CONTROL",
                    id: a,
                    name: b,
                    app: c,
                    mdxVersion: 3
                };
                g.ua("yt.mdx.remote.channelParams_", a, void 0)
            }
        }
            , A8 = function() {
            return g.y("yt.mdx.remote.channelParams_") || {}
        }
            , AFa = function(a) {
            a ? (g.fH("yt-remote-session-app", a.app),
                g.fH("yt-remote-session-name", a.name)) : (g.hH("yt-remote-session-app"),
                g.hH("yt-remote-session-name"));
            g.ua("yt.mdx.remote.channelParams_", a, void 0)
        }
            , J8 = function(a, b, c) {
            g.M.call(this);
            this.H = a;
            this.A = b;
            this.B = new g.UF(this);
            g.N(this, this.B);
            this.B.R(b, "onCaptionsTrackListChanged", this.ZS);
            this.B.R(b, "captionschanged", this.DR);
            this.B.R(b, "captionssettingschanged", this.vF);
            this.B.R(b, "videoplayerreset", this.Up);
            this.B.R(b, "mdxautoplaycancel", this.GJ);
            this.T = this.B.R(b, "onVolumeChange", this.yD);
            this.G = !1;
            this.o = c;
            c.subscribe("proxyStateChange", this.LD, this);
            c.subscribe("remotePlayerChange", this.Om, this);
            c.subscribe("remoteQueueChange", this.Up, this);
            c.subscribe("autoplayUpNext", this.jD, this);
            c.subscribe("previousNextChange", this.ID, this);
            c.subscribe("nowAutoplaying", this.AD, this);
            c.subscribe("autoplayDismissed", this.iD, this);
            this.suggestion = null;
            this.J = new g.kQ(64);
            this.C = new g.nu(this.rF,500,this);
            g.N(this, this.C);
            this.D = new g.nu(this.sF,1E3,this);
            g.N(this, this.D);
            this.L = new I6(this.mX,0,this);
            g.N(this, this.L);
            this.F = {};
            this.M = new g.nu(this.RF,1E3,this);
            g.N(this, this.M);
            this.K = new g.hl(this.CP,1E3,this);
            g.N(this, this.K);
            this.O = g.z;
            this.vF();
            this.Up();
            this.Om()
        }
            , K8 = function(a, b) {
            var c = a.H
                , d = a.A.getVideoData().lengthSeconds;
            c.J = b || 0;
            c.o.V("progresssync", b, d)
        }
            , IFa = function(a) {
            K8(a, 0);
            a.C.stop();
            L8(a, new g.kQ(64))
        }
            , N8 = function(a, b) {
            if (M8(a) && !a.G) {
                var c = null;
                b && (c = {
                    style: a.A.Yi()
                },
                    g.hc(c, b));
                a.o.fF(a.A.getVideoData(1).videoId, c);
                a.F = e8(a.o).A
            }
        }
            , O8 = function(a, b) {
            var c = a.A.jg();
            if (c) {
                var d = c.re();
                var e = c.listId.toString()
            }
            var f = a.A.getVideoData(1);
            c = a.o;
            var k = f.videoId
                , l = d;
            d = f.playerParams;
            var m = f.ik;
            f = sDa(f);
            var n = e8(c);
            l = l || 0;
            var p = {
                videoId: k,
                currentIndex: l
            };
            a8(n, k, l);
            g.u(b) && (Z7(n, b),
                p.currentTime = b);
            g.u(e) && (p.listId = e);
            null != d && (p.playerParams = d);
            null != m && (p.clickTrackingParams = m);
            null != f && (p.locationInfo = g.Jg(f));
            i8(c, "setPlaylist", p);
            e || g8(c, n);
            L8(a, new g.kQ(1))
        }
            , JFa = function(a, b) {
            if (b) {
                var c = a.A.Ac("captions", "tracklist", {
                    IA: 1
                });
                c && c.length ? (a.A.Td("captions", "track", b),
                    a.G = !1) : (a.A.zk("captions"),
                    a.G = !0)
            } else
                a.A.Td("captions", "track", {})
        }
            , M8 = function(a) {
            return e8(a.o).videoId == a.A.getVideoData(1).videoId
        }
            , L8 = function(a, b) {
            a.D.stop();
            var c = a.J;
            if (!g.pQ(c, b)) {
                var d = g.X(b, 2);
                d != g.X(a.J, 2) && g.jU(a.A, d);
                a.J = b;
                KFa(a.H, c, b)
            }
        }
            , P8 = function(a) {
            g.W.call(this, {
                I: "div",
                N: "ytp-remote",
                P: [{
                    I: "div",
                    N: "ytp-remote-display-status",
                    P: [{
                        I: "div",
                        N: "ytp-remote-display-status-icon",
                        P: [g.jra()]
                    }, {
                        I: "div",
                        N: "ytp-remote-display-status-text",
                        ca: "{{statustext}}"
                    }]
                }]
            });
            this.A = new g.$U(this,250);
            g.N(this, this.A);
            this.C = a;
            this.R(a, "presentingplayerstatechange", this.D);
            LFa(this, g.gU(a))
        }
            , LFa = function(a, b) {
            if (3 == a.C.Ra()) {
                var c = {
                    RECEIVER_NAME: a.C.Ac("remote", "currentReceiver").name
                };
                c = g.X(b, 128) ? g.f0("\u5728$RECEIVER_NAME\u4e0a\u51fa\u73b0\u9519\u8bef", c) : b.qb() || g.X(b, 4) ? g.f0("\u6b63\u5728$RECEIVER_NAME\u4e0a\u64ad\u653e", c) : g.f0("\u5df2\u8fde\u63a5\u5230$RECEIVER_NAME", c);
                a.updateValue("statustext", c);
                a.A.show()
            } else
                a.A.hide()
        }
            , Q8 = function(a, b) {
            g.kZ.call(this, "\u64ad\u653e\u8bbe\u5907", 0, a, b);
            this.A = a;
            this.J = {};
            this.R(a, "onMdxReceiversChange", this.L);
            this.R(a, "presentingplayerstatechange", this.L);
            this.L()
        }
            , R8 = function(a) {
            g.GU.call(this, a);
            this.B = {
                key: t6(),
                name: "\u6b64\u8ba1\u7b97\u673a"
            };
            this.D = null;
            this.F = [];
            this.K = this.A = null;
            this.H = [this.B];
            this.C = this.B;
            this.G = new g.kQ(64);
            this.J = 0;
            if (!g.FN(g.Y(this.o))) {
                a = this.o;
                var b = g.YH(a);
                b && (b = b.rp()) && (b = new Q8(a,b),
                    g.N(this, b));
                b = new P8(a);
                g.N(this, b);
                g.zU(a, b.element, 4)
            }
        }
            , KFa = function(a, b, c) {
            a.G = c;
            a.o.V("presentingplayerstatechange", new g.uQ(c,b))
        }
            , S8 = function(a, b) {
            if (b.key != a.C.key)
                if (b.key == a.B.key)
                    E8();
                else {
                    a.C = b;
                    var c = a.o.getPlaylistId();
                    var d = a.o.getVideoData(1);
                    var e = d.videoId;
                    if (c || e) {
                        var f = a.o.jg();
                        if (f) {
                            var k = [];
                            for (var l = 0; l < f.getLength(); l++)
                                k[l] = f.ac(l).videoId
                        } else
                            k = [e];
                        f = a.o.getCurrentTime(1);
                        c = {
                            videoIds: k,
                            listId: c,
                            videoId: e,
                            playerParams: d.playerParams,
                            clickTrackingParams: d.ik,
                            index: Math.max(a.o.MB(), 0),
                            currentTime: 0 == f ? void 0 : f
                        };
                        (d = sDa(d)) && (c.locationInfo = d);
                        d = c
                    } else
                        d = null;
                    w8("Connecting to: " + g.Jg(b));
                    "cast-selector-receiver" == b.key ? (y8(d || null),
                        T7() ? Q7().setLaunchParams(d || null) : O7("setLaunchParams called before ready.")) : !d && H8() && v8() == b.key ? g.mG("yt-remote-connection-change", !0) : (E8(),
                        y8(d || null),
                        d = u8().te(),
                    (d = v6(d, b.key)) && F8(d, 1))
                }
        }
            , $Da = {
            "\x00": "\\0",
            "\b": "\\b",
            "\f": "\\f",
            "\n": "\\n",
            "\r": "\\r",
            "\t": "\\t",
            "\x0B": "\\x0B",
            '"': '\\"',
            "\\": "\\\\",
            "<": "<"
        }
            , S6 = {
            "'": "\\'"
        }
            , MFa = {}
            , yDa = {
            bZ: "atp",
            F3: "ska",
            U2: "que",
            e2: "mus",
            B3: "sus",
            k0: "dsp"
        };
        o6.prototype.ho = function() {
            var a = new o6({
                id: this.id,
                name: this.name,
                app: this.app,
                type: this.type,
                user: this.username,
                userAvatarUri: this.avatar,
                obfuscatedGaiaId: this.obfuscatedGaiaId,
                theme: this.theme,
                capabilities: Array.from(this.capabilities.values()).join(","),
                experiments: Array.from(this.experiments.values()).join(",")
            });
            a.B = this.B;
            a.A = this.A;
            a.o = this.o
        }
        ;
        var B6, x6 = "", F6 = C6("loadGamesSDK") ? "/cast_game_sender.js" : "/cast_sender.js", SDa = C6("loadCastFramework") || C6("loadCastApplicationFramework"), bFa = ["pkedcjkdefgpdelpbcmbmeomcjbeemfm", "enhhojjnijigcajfphajepfemndkmdlo"];
        g.B(I6, g.M);
        g.h = I6.prototype;
        g.h.CK = function(a) {
            this.C = arguments;
            this.o = !1;
            this.Fa ? this.B = (0,
                g.G)() + this.wd : this.Fa = g.Dg(this.D, this.wd)
        }
        ;
        g.h.stop = function() {
            this.Fa && (g.Eg(this.Fa),
                this.Fa = null);
            this.B = null;
            this.o = !1;
            this.C = []
        }
        ;
        g.h.pause = function() {
            ++this.A
        }
        ;
        g.h.resume = function() {
            this.A && (--this.A,
            !this.A && this.o && (this.o = !1,
                this.F.apply(null, this.C)))
        }
        ;
        g.h.X = function() {
            this.stop();
            I6.ea.X.call(this)
        }
        ;
        g.h.DK = function() {
            this.B ? (this.Fa = g.Dg(this.D, this.B - (0,
                g.G)()),
                this.B = null) : (this.Fa = null,
                this.A ? this.o = !0 : (this.o = !1,
                    this.F.apply(null, this.C)))
        }
        ;
        J6.prototype.stringify = function(a) {
            return g.x.JSON.stringify(a, void 0)
        }
        ;
        J6.prototype.parse = function(a) {
            return g.x.JSON.parse(a, void 0)
        }
        ;
        g.h = K6.prototype;
        g.h.Ei = null;
        g.h.Hf = !1;
        g.h.ll = null;
        g.h.Iw = null;
        g.h.Qk = null;
        g.h.Zj = null;
        g.h.zh = null;
        g.h.bi = null;
        g.h.fj = null;
        g.h.Rc = null;
        g.h.mn = 0;
        g.h.If = null;
        g.h.Wq = null;
        g.h.Ah = null;
        g.h.Xl = -1;
        g.h.LE = !0;
        g.h.pi = !1;
        g.h.Zs = 0;
        g.h.hq = null;
        var YDa = {}
            , N6 = {};
        g.h = K6.prototype;
        g.h.setTimeout = function(a) {
            this.C = a
        }
        ;
        g.h.cW = function(a) {
            a = a.target;
            var b = this.hq;
            b && 3 == g.yx(a) ? b.Xj() : this.bG(a)
        }
        ;
        g.h.bG = function(a) {
            try {
                if (a == this.Rc)
                    a: {
                        var b = g.yx(this.Rc)
                            , c = this.Rc.A
                            , d = this.Rc.getStatus();
                        if (g.Fd && !g.uc(10) || g.Hd && !g.tc("420+")) {
                            if (4 > b)
                                break a
                        } else if (3 > b || 3 == b && !g.of && !g.Cx(this.Rc))
                            break a;
                        this.pi || 4 != b || 7 == c || (8 == c || 0 >= d ? this.o.Bf(3) : this.o.Bf(2));
                        U6(this);
                        var e = this.Rc.getStatus();
                        this.Xl = e;
                        var f = g.Cx(this.Rc);
                        (this.Hf = 200 == e) ? (4 == b && Q6(this),
                            this.D ? (ZDa(this, b, f),
                            g.of && this.Hf && 3 == b && (this.Y.W(this.A, "tick", this.YV),
                                this.A.start())) : P6(this, f),
                        this.Hf && !this.pi && (4 == b ? this.o.Sp(this) : (this.Hf = !1,
                            M6(this)))) : (400 == e && 0 < f.indexOf("Unknown SID") ? (this.Ah = 3,
                            O6(13)) : (this.Ah = 0,
                            O6(14)),
                            Q6(this),
                            R6(this))
                    }
            } catch (k) {
                this.Rc && g.Cx(this.Rc)
            } finally {}
        }
        ;
        g.h.YV = function() {
            var a = g.yx(this.Rc)
                , b = g.Cx(this.Rc);
            this.mn < b.length && (U6(this),
                ZDa(this, a, b),
            this.Hf && 4 != a && M6(this))
        }
        ;
        g.h.iV = function(a) {
            T6((0,
                g.A)(this.hV, this, a), 0)
        }
        ;
        g.h.hV = function(a) {
            this.pi || (U6(this),
                P6(this, a),
                M6(this))
        }
        ;
        g.h.UD = function(a) {
            T6((0,
                g.A)(this.gV, this, a), 0)
        }
        ;
        g.h.gV = function(a) {
            this.pi || (Q6(this),
                this.Hf = a,
                this.o.Sp(this),
                this.o.Bf(4))
        }
        ;
        g.h.cancel = function() {
            this.pi = !0;
            Q6(this)
        }
        ;
        g.h.yV = function() {
            this.ll = null;
            var a = (0,
                g.G)();
            0 <= a - this.Iw ? (2 != this.Zj && this.o.Bf(3),
                Q6(this),
                this.Ah = 2,
                O6(18),
                R6(this)) : bEa(this, this.Iw - a)
        }
        ;
        g.h = eEa.prototype;
        g.h.Xs = null;
        g.h.Be = null;
        g.h.iq = !1;
        g.h.Zz = null;
        g.h.uo = null;
        g.h.eu = null;
        g.h.Ys = null;
        g.h.Ue = null;
        g.h.Lg = -1;
        g.h.Wl = null;
        g.h.wl = null;
        g.h.connect = function(a) {
            this.Ys = a;
            a = W6(this.o, null, this.Ys);
            O6(3);
            this.Zz = (0,
                g.G)();
            var b = this.o.H;
            null != b ? (this.Wl = b[0],
                (this.wl = b[1]) ? (this.Ue = 1,
                    fEa(this)) : (this.Ue = 2,
                    Y6(this))) : (n6(a, "MODE", "init"),
                this.Be = new K6(this,void 0,void 0,void 0),
                this.Be.Ei = this.Xs,
                L6(this.Be, a, !1, null, !0),
                this.Ue = 0)
        }
        ;
        g.h.HJ = function(a) {
            if (a)
                this.Ue = 2,
                    Y6(this);
            else {
                O6(4);
                var b = this.o;
                b.Wf = b.nh.Lg;
                e7(b, 9)
            }
            a && this.Bf(2)
        }
        ;
        g.h.rs = function(a) {
            return this.o.rs(a)
        }
        ;
        g.h.abort = function() {
            this.Be && (this.Be.cancel(),
                this.Be = null);
            this.Lg = -1
        }
        ;
        g.h.Yz = function() {
            return !1
        }
        ;
        g.h.MD = function(a, b) {
            this.Lg = a.Xl;
            if (0 == this.Ue)
                if (b) {
                    try {
                        var c = this.A.parse(b)
                    } catch (d) {
                        c = this.o;
                        c.Wf = this.Lg;
                        e7(c, 2);
                        return
                    }
                    this.Wl = c[0];
                    this.wl = c[1]
                } else
                    c = this.o,
                        c.Wf = this.Lg,
                        e7(c, 2);
            else if (2 == this.Ue)
                if (this.iq)
                    O6(7),
                        this.eu = (0,
                            g.G)();
                else if ("11111" == b) {
                    if (O6(6),
                        this.iq = !0,
                        this.uo = (0,
                            g.G)(),
                        c = this.uo - this.Zz,
                    !g.Fd || g.uc(10) || 500 > c)
                        this.Lg = 200,
                            this.Be.cancel(),
                            O6(12),
                            X6(this.o, this, !0)
                } else
                    O6(8),
                        this.uo = this.eu = (0,
                            g.G)(),
                        this.iq = !1
        }
        ;
        g.h.Sp = function() {
            this.Lg = this.Be.Xl;
            if (this.Be.Hf)
                0 == this.Ue ? this.wl ? (this.Ue = 1,
                    fEa(this)) : (this.Ue = 2,
                    Y6(this)) : 2 == this.Ue && ((!g.Fd || g.uc(10) ? !this.iq : 200 > this.eu - this.uo) ? (O6(11),
                    X6(this.o, this, !1)) : (O6(12),
                    X6(this.o, this, !0)));
            else {
                0 == this.Ue ? O6(9) : 2 == this.Ue && O6(10);
                var a = this.o;
                a.Wf = this.Lg;
                e7(a, 2)
            }
        }
        ;
        g.h.Zm = function() {
            return this.o.Zm()
        }
        ;
        g.h.isActive = function() {
            return this.o.isActive()
        }
        ;
        g.h.Bf = function(a) {
            this.o.Bf(a)
        }
        ;
        g.h = Z6.prototype;
        g.h.Il = null;
        g.h.fe = null;
        g.h.wc = null;
        g.h.Ws = null;
        g.h.yo = null;
        g.h.oy = null;
        g.h.Lo = null;
        g.h.Im = 0;
        g.h.VQ = 0;
        g.h.ud = null;
        g.h.rh = null;
        g.h.zg = null;
        g.h.ti = null;
        g.h.nh = null;
        g.h.Vq = null;
        g.h.nk = -1;
        g.h.XA = -1;
        g.h.Wf = -1;
        g.h.Nj = 0;
        g.h.Bj = 0;
        g.h.si = 8;
        var f7 = new g.Pf;
        g.B(hEa, g.mf);
        g.B(iEa, g.mf);
        g.B(jEa, g.mf);
        g.h = Z6.prototype;
        g.h.connect = function(a, b, c, d, e) {
            O6(0);
            this.Ws = b;
            this.Il = c || {};
            d && g.u(e) && (this.Il.OSID = d,
                this.Il.OAID = e);
            this.F ? (T6((0,
                g.A)(this.My, this, a), 100),
                nEa(this)) : this.My(a)
        }
        ;
        g.h.My = function(a) {
            this.nh = new eEa(this);
            this.nh.Xs = null;
            this.nh.A = this.D;
            this.nh.connect(a)
        }
        ;
        g.h.Yz = function() {
            return 0 == this.o
        }
        ;
        g.h.SD = function(a) {
            this.rh = null;
            qEa(this, a)
        }
        ;
        g.h.RD = function() {
            this.zg = null;
            this.wc = new K6(this,this.B,"rpc",this.G);
            this.wc.Ei = null;
            this.wc.Zs = 0;
            var a = this.oy.clone();
            g.Qm(a, "RID", "rpc");
            g.Qm(a, "SID", this.B);
            g.Qm(a, "CI", this.Vq ? "0" : "1");
            g.Qm(a, "AID", this.nk);
            $6(this, a);
            if (!g.Fd || g.uc(10))
                g.Qm(a, "TYPE", "xmlhttp"),
                    L6(this.wc, a, !0, this.Lo, !1);
            else {
                g.Qm(a, "TYPE", "html");
                var b = this.wc
                    , c = !!this.Lo;
                b.Zj = 3;
                b.zh = m6(a.clone());
                aEa(b, c)
            }
        }
        ;
        g.h.MD = function(a, b) {
            if (0 != this.o && (this.wc == a || this.fe == a))
                if (this.Wf = a.Xl,
                this.fe == a && 3 == this.o)
                    if (7 < this.si) {
                        try {
                            var c = this.D.parse(b)
                        } catch (f) {
                            c = null
                        }
                        if (g.za(c) && 3 == c.length)
                            if (0 == c[0])
                                a: {
                                    if (!this.zg) {
                                        if (this.wc)
                                            if (this.wc.Qk + 3E3 < this.fe.Qk)
                                                b7(this),
                                                    this.wc.cancel(),
                                                    this.wc = null;
                                            else
                                                break a;
                                        d7(this);
                                        O6(19)
                                    }
                                }
                            else
                                this.XA = c[1],
                                0 < this.XA - this.nk && 37500 > c[2] && this.Vq && 0 == this.Bj && !this.ti && (this.ti = T6((0,
                                    g.A)(this.xR, this), 6E3));
                        else
                            e7(this, 11)
                    } else
                        b != MFa.e_.o && e7(this, 11);
                else if (this.wc == a && b7(this),
                    !g.E(b)) {
                    c = this.D.parse(b);
                    g.za(c);
                    for (var d = 0; d < c.length; d++) {
                        var e = c[d];
                        this.nk = e[0];
                        e = e[1];
                        2 == this.o ? "c" == e[0] ? (this.B = e[1],
                            this.Lo = e[2],
                            e = e[3],
                            null != e ? this.si = e : this.si = 6,
                            this.o = 3,
                        this.ud && this.ud.Dy(),
                            this.oy = W6(this, this.Zm() ? this.Lo : null, this.Ws),
                            rEa(this)) : "stop" == e[0] && e7(this, 7) : 3 == this.o && ("stop" == e[0] ? e7(this, 7) : "noop" != e[0] && this.ud && this.ud.Cy(e),
                            this.Bj = 0)
                    }
                }
        }
        ;
        g.h.xR = function() {
            null != this.ti && (this.ti = null,
                this.wc.cancel(),
                this.wc = null,
                d7(this),
                O6(20))
        }
        ;
        g.h.Sp = function(a) {
            if (this.wc == a) {
                b7(this);
                this.wc = null;
                var b = 2
            } else if (this.fe == a)
                this.fe = null,
                    b = 1;
            else
                return;
            this.Wf = a.Xl;
            if (0 != this.o)
                if (a.Hf)
                    1 == b ? (b = (0,
                        g.G)() - a.Qk,
                        f7.dispatchEvent(new iEa(f7,a.fj ? a.fj.length : 0,b,this.Nj)),
                        a7(this),
                        this.C.length = 0) : rEa(this);
                else {
                    var c = a.Ah, d;
                    if (!(d = 3 == c || 7 == c || 0 == c && 0 < this.Wf)) {
                        if (d = 1 == b)
                            this.fe || this.rh || 1 == this.o || 2 <= this.Nj ? d = !1 : (this.rh = T6((0,
                                g.A)(this.SD, this, a), sEa(this, this.Nj)),
                                this.Nj++,
                                d = !0);
                        d = !(d || 2 == b && d7(this))
                    }
                    if (d)
                        switch (c) {
                            case 1:
                                e7(this, 5);
                                break;
                            case 4:
                                e7(this, 10);
                                break;
                            case 3:
                                e7(this, 6);
                                break;
                            case 7:
                                e7(this, 12);
                                break;
                            default:
                                e7(this, 2)
                        }
                }
        }
        ;
        g.h.dK = function(a) {
            if (!g.Oa(arguments, this.o))
                throw Error("Unexpected channel state: " + this.o);
        }
        ;
        g.h.XW = function(a) {
            a ? O6(2) : (O6(1),
                tEa(this, 8))
        }
        ;
        g.h.rs = function(a) {
            if (a)
                throw Error("Can't create secondary domain capable XhrIo object.");
            a = new g.sx;
            a.H = !1;
            return a
        }
        ;
        g.h.isActive = function() {
            return !!this.ud && this.ud.isActive(this)
        }
        ;
        g.h.Bf = function(a) {
            f7.dispatchEvent(new jEa(f7,a))
        }
        ;
        g.h.Zm = function() {
            return !(!g.Fd || g.uc(10))
        }
        ;
        g.h = uEa.prototype;
        g.h.Dy = function() {}
        ;
        g.h.Cy = function() {}
        ;
        g.h.By = function() {}
        ;
        g.h.Xr = function() {}
        ;
        g.h.Fz = function() {
            return {}
        }
        ;
        g.h.isActive = function() {
            return !0
        }
        ;
        g.B(g7, g.M);
        g.h = g7.prototype;
        g.h.ZU = function() {
            this.wd = Math.min(3E5, 2 * this.wd);
            this.B();
            this.A && this.start()
        }
        ;
        g.h.start = function() {
            var a = this.wd + 15E3 * Math.random();
            g.ou(this.o, a);
            this.A = (0,
                g.G)() + a
        }
        ;
        g.h.stop = function() {
            this.o.stop();
            this.A = 0
        }
        ;
        g.h.isActive = function() {
            return this.o.isActive()
        }
        ;
        g.h.reset = function() {
            this.o.stop();
            this.wd = 5E3
        }
        ;
        g.B(h7, uEa);
        g.h = h7.prototype;
        g.h.subscribe = function(a, b, c) {
            return this.B.subscribe(a, b, c)
        }
        ;
        g.h.unsubscribe = function(a, b, c) {
            return this.B.unsubscribe(a, b, c)
        }
        ;
        g.h.Yd = function(a) {
            return this.B.Yd(a)
        }
        ;
        g.h.V = function(a, b) {
            return this.B.V.apply(this.B, arguments)
        }
        ;
        g.h.dispose = function() {
            this.K || (this.K = !0,
                g.kf(this.B),
                xEa(this),
                g.kf(this.A),
                this.A = null)
        }
        ;
        g.h.ma = function() {
            return this.K
        }
        ;
        g.h.connect = function(a, b, c) {
            if (!this.o || 2 != this.o.o) {
                this.J = "";
                this.A.stop();
                this.D = a || null;
                this.C = b || 0;
                a = this.L + "/test";
                b = this.L + "/bind";
                var d = new Z6(c ? c.firstTestResults : null,c ? c.secondTestResults : null,this.M)
                    , e = this.o;
                e && (e.ud = null);
                d.ud = this;
                this.o = d;
                e ? this.o.connect(a, b, this.F, e.B, e.nk) : c ? this.o.connect(a, b, this.F, c.sessionId, c.arrayId) : this.o.connect(a, b, this.F)
            }
        }
        ;
        g.h.sendMessage = function(a, b) {
            var c = {
                _sc: a
            };
            b && g.hc(c, b);
            this.A.isActive() || 2 == (this.o ? this.o.o : 0) ? this.G.push(c) : i7(this) && oEa(this.o, c)
        }
        ;
        g.h.Dy = function() {
            this.A.reset();
            this.D = null;
            this.C = 0;
            if (this.G.length) {
                var a = this.G;
                this.G = [];
                for (var b = 0, c = a.length; b < c; ++b)
                    oEa(this.o, a[b])
            }
            this.V("handlerOpened")
        }
        ;
        g.h.By = function(a) {
            var b = 2 == a && 401 == this.o.Wf;
            4 == a || b || this.A.start();
            this.V("handlerError", a)
        }
        ;
        g.h.Xr = function(a) {
            if (!this.A.isActive())
                this.V("handlerClosed");
            else if (a)
                for (var b = 0, c = a.length; b < c; ++b) {
                    var d = a[b].map;
                    d && this.G.push(d)
                }
        }
        ;
        g.h.Fz = function() {
            var a = {
                v: 2
            };
            this.J && (a.gsessionid = this.J);
            0 != this.C && (a.ui = "" + this.C);
            0 != this.H && (a.ui = "" + this.H);
            this.D && g.hc(a, this.D);
            return a
        }
        ;
        g.h.Cy = function(a) {
            "S" == a[0] ? this.J = a[1] : "gracefulReconnect" == a[0] ? (this.A.start(),
                mEa(this.o)) : this.V("handlerMessage", new vEa(a[0],a[1]))
        }
        ;
        g.h.HX = function() {
            this.A.isActive();
            var a = this.o
                , b = 0;
            a.wc && b++;
            a.fe && b++;
            0 != b || this.connect(this.D, this.C)
        }
        ;
        j7.prototype.C = function(a, b, c, d) {
            b ? a(d) : a({
                text: c.responseText
            })
        }
        ;
        j7.prototype.B = function(a, b) {
            a(Error("Request error: " + b.status))
        }
        ;
        j7.prototype.D = function(a) {
            a(Error("request timed out"))
        }
        ;
        var FEa = (0,
            g.G)()
            , m7 = null
            , p7 = Array(50)
            , o7 = -1
            , q7 = !1;
        g.B(r7, g.XF);
        r7.prototype.te = function() {
            return this.o
        }
        ;
        r7.prototype.contains = function(a) {
            return !!u6(this.o, a)
        }
        ;
        r7.prototype.get = function(a) {
            return a ? v6(this.o, a) : null
        }
        ;
        r7.prototype.info = function(a) {
            n7(this.G, a)
        }
        ;
        g.B(s7, g.XF);
        var NFa = [2E3, 2E3, 1E3, 1E3, 1E3, 2E3, 2E3, 5E3, 5E3, 1E4];
        g.h = s7.prototype;
        g.h.start = function() {
            !this.o && (0,
                window.isNaN)(this.Fa) && this.gG()
        }
        ;
        g.h.stop = function() {
            this.o && (this.o.abort(),
                this.o = null);
            (0,
                window.isNaN)(this.Fa) || (g.oE(this.Fa),
                this.Fa = window.NaN)
        }
        ;
        g.h.X = function() {
            this.stop();
            s7.ea.X.call(this)
        }
        ;
        g.h.gG = function() {
            this.Fa = window.NaN;
            this.o = g.DE(k7(this.F, "/pairing/get_screen"), {
                method: "POST",
                Pb: {
                    pairing_code: this.D
                },
                timeout: 5E3,
                onSuccess: (0,
                    g.A)(this.JX, this),
                onError: (0,
                    g.A)(this.IX, this),
                Bd: (0,
                    g.A)(this.KX, this)
            })
        }
        ;
        g.h.JX = function(a, b) {
            this.o = null;
            var c = b.screen || {};
            c.dialId = this.B;
            c.name = this.C;
            this.V("pairingComplete", new p6(c))
        }
        ;
        g.h.IX = function(a) {
            this.o = null;
            a.status && 404 == a.status ? this.A >= NFa.length ? this.V("pairingFailed", Error("DIAL polling timed out")) : (a = NFa[this.A],
                this.Fa = g.mE((0,
                    g.A)(this.gG, this), a),
                this.A++) : this.V("pairingFailed", Error("Server error " + a.status))
        }
        ;
        g.h.KX = function() {
            this.o = null;
            this.V("pairingFailed", Error("Server not responding"))
        }
        ;
        g.B(u7, r7);
        g.h = u7.prototype;
        g.h.start = function() {
            t7(this) && this.V("screenChange");
            !g.gH("yt-remote-lounge-token-expiration") && JEa(this);
            g.oE(this.A);
            this.A = g.mE((0,
                g.A)(this.start, this), 1E4)
        }
        ;
        g.h.add = function(a, b) {
            t7(this);
            GEa(this, a);
            v7(this, !1);
            this.V("screenChange");
            b(a);
            a.token || JEa(this)
        }
        ;
        g.h.remove = function(a, b) {
            var c = t7(this);
            IEa(this, a) && (v7(this, !1),
                c = !0);
            b(a);
            c && this.V("screenChange")
        }
        ;
        g.h.Pq = function(a, b, c, d) {
            var e = t7(this)
                , f = this.get(a.id);
            f ? (f.name != b && (f.name = b,
                v7(this, !1),
                e = !0),
                c(a)) : d(Error("no such local screen."));
            e && this.V("screenChange")
        }
        ;
        g.h.X = function() {
            g.oE(this.A);
            u7.ea.X.call(this)
        }
        ;
        g.h.QK = function(a) {
            t7(this);
            var b = this.o.length;
            a = a && a.screens || [];
            for (var c = 0, d = a.length; c < d; ++c) {
                var e = a[c]
                    , f = this.get(e.screenId);
                f && (f.token = e.loungeToken,
                    --b)
            }
            v7(this, !b);
            b && n7(this.G, "Missed " + b + " lounge tokens.")
        }
        ;
        g.h.PK = function(a) {
            n7(this.G, "Requesting lounge tokens failed: " + a)
        }
        ;
        g.B(x7, g.XF);
        g.h = x7.prototype;
        g.h.start = function() {
            var a = (0,
                window.parseInt)(g.gH("yt-remote-fast-check-period") || "0", 10);
            (this.C = (0,
                g.G)() - 144E5 < a ? 0 : a) ? z7(this) : (this.C = (0,
                g.G)() + 3E5,
                g.fH("yt-remote-fast-check-period", this.C),
                this.Tv())
        }
        ;
        g.h.isEmpty = function() {
            return g.Zb(this.o)
        }
        ;
        g.h.update = function() {
            w7("Updating availability on schedule.");
            var a = this.F()
                , b = g.Mb(this.o, function(b, d) {
                return b && !!v6(a, d)
            }, this);
            y7(this, b)
        }
        ;
        g.h.X = function() {
            g.oE(this.B);
            this.B = window.NaN;
            this.A && (this.A.abort(),
                this.A = null);
            x7.ea.X.call(this)
        }
        ;
        g.h.Tv = function() {
            g.oE(this.B);
            this.B = window.NaN;
            this.A && this.A.abort();
            var a = MEa(this);
            if (g.Pb(a)) {
                var b = k7(this.D, "/pairing/get_screen_availability");
                this.A = l7(this.D, b, {
                    lounge_token: g.Tb(a).join(",")
                }, (0,
                    g.A)(this.HU, this, a), (0,
                    g.A)(this.GU, this))
            } else
                y7(this, {}),
                    z7(this)
        }
        ;
        g.h.HU = function(a, b) {
            this.A = null;
            var c = g.Tb(MEa(this));
            if (g.gb(c, g.Tb(a))) {
                c = b.screens || [];
                for (var d = {}, e = 0, f = c.length; e < f; ++e)
                    d[a[c[e].loungeToken]] = "online" == c[e].status;
                y7(this, d);
                z7(this)
            } else
                this.hc("Changing Screen set during request."),
                    this.Tv()
        }
        ;
        g.h.GU = function(a) {
            this.hc("Screen availability failed: " + a);
            this.A = null;
            z7(this)
        }
        ;
        g.h.hc = function(a) {
            n7("OnlineScreenService", a)
        }
        ;
        g.B(A7, r7);
        g.h = A7.prototype;
        g.h.start = function() {
            this.B.start();
            this.A.start();
            this.o.length && (this.V("screenChange"),
            this.A.isEmpty() || this.V("onlineScreenChange"))
        }
        ;
        g.h.add = function(a, b, c) {
            this.B.add(a, b, c)
        }
        ;
        g.h.remove = function(a, b, c) {
            this.B.remove(a, b, c);
            this.A.update()
        }
        ;
        g.h.Pq = function(a, b, c, d) {
            this.B.contains(a) ? this.B.Pq(a, b, c, d) : (a = "Updating name of unknown screen: " + a.name,
                n7(this.G, a),
                d(Error(a)))
        }
        ;
        g.h.te = function(a) {
            return a ? this.o : g.Va(this.o, (0,
                g.Td)(this.C, function(a) {
                return !this.contains(a)
            }, this))
        }
        ;
        g.h.hG = function() {
            return (0,
                g.Td)(this.te(!0), function(a) {
                return !!this.A.o[a.id]
            }, this)
        }
        ;
        g.h.iG = function(a, b, c, d, e) {
            this.info("getDialScreenByPairingCode " + a + " / " + b);
            var f = new s7(this.F,a,b,c);
            f.subscribe("pairingComplete", (0,
                g.A)(function(a) {
                g.kf(f);
                d(B7(this, a))
            }, this));
            f.subscribe("pairingFailed", function(a) {
                g.kf(f);
                e(a)
            });
            f.start();
            return (0,
                g.A)(f.stop, f)
        }
        ;
        g.h.MX = function(a, b, c, d) {
            g.DE(k7(this.F, "/pairing/get_screen"), {
                method: "POST",
                Pb: {
                    pairing_code: a
                },
                timeout: 5E3,
                onSuccess: (0,
                    g.A)(function(a, d) {
                    var e = new p6(d.screen || {});
                    if (!e.name || QEa(this, e.name)) {
                        a: {
                            var f = e.name;
                            for (var m = 2, n = b(f, m); QEa(this, n); ) {
                                m++;
                                if (20 < m)
                                    break a;
                                n = b(f, m)
                            }
                            f = n
                        }
                        e.name = f
                    }
                    c(B7(this, e))
                }, this),
                onError: (0,
                    g.A)(function(a) {
                    d(Error("pairing request failed: " + a.status))
                }, this),
                Bd: (0,
                    g.A)(function() {
                    d(Error("pairing request timed out."))
                }, this)
            })
        }
        ;
        g.h.X = function() {
            g.kf(this.B);
            g.kf(this.A);
            A7.ea.X.call(this)
        }
        ;
        g.h.fL = function() {
            REa(this);
            this.V("screenChange");
            this.A.update()
        }
        ;
        A7.prototype.dispose = A7.prototype.dispose;
        g.B(D7, g.XF);
        g.h = D7.prototype;
        g.h.Tp = function(a) {
            this.B = a;
            this.V("sessionScreen", this.B)
        }
        ;
        g.h.ze = function(a) {
            this.ma() || (a && E7(this, "" + a),
                this.B = null,
                this.V("sessionScreen", null))
        }
        ;
        g.h.info = function(a) {
            n7(this.M, a)
        }
        ;
        g.h.kG = function() {
            return null
        }
        ;
        g.h.Zv = function(a) {
            var b = this.A;
            a ? (b.displayStatus = new window.chrome.cast.ReceiverDisplayStatus(a,[]),
                b.displayStatus.showStop = !0) : b.displayStatus = null;
            window.chrome.cast.setReceiverDisplayStatus(b, (0,
                g.A)(function() {
                this.info("Updated receiver status for " + b.friendlyName + ": " + a)
            }, this), (0,
                g.A)(function() {
                E7(this, "Failed to update receiver status for: " + b.friendlyName)
            }, this))
        }
        ;
        g.h.X = function() {
            this.Zv("");
            D7.ea.X.call(this)
        }
        ;
        g.B(F7, D7);
        g.h = F7.prototype;
        g.h.Yv = function(a) {
            if (this.o) {
                if (this.o == a)
                    return;
                E7(this, "Overriding cast sesison with new session object");
                this.o.removeUpdateListener(this.F);
                this.o.removeMessageListener("urn:x-cast:com.google.youtube.mdx", this.D)
            }
            this.o = a;
            this.o.addUpdateListener(this.F);
            this.o.addMessageListener("urn:x-cast:com.google.youtube.mdx", this.D);
            TEa(this)
        }
        ;
        g.h.qk = function(a) {
            this.info("launchWithParams no-op for Cast: " + g.Jg(a))
        }
        ;
        g.h.stop = function() {
            this.o ? this.o.stop((0,
                g.A)(function() {
                this.ze()
            }, this), (0,
                g.A)(function() {
                this.ze(Error("Failed to stop receiver app."))
            }, this)) : this.ze(Error("Stopping cast device witout session."))
        }
        ;
        g.h.Zv = g.z;
        g.h.X = function() {
            this.info("disposeInternal");
            g.oE(this.C);
            this.C = 0;
            this.o && (this.o.removeUpdateListener(this.F),
                this.o.removeMessageListener("urn:x-cast:com.google.youtube.mdx", this.D));
            this.o = null;
            F7.ea.X.call(this)
        }
        ;
        g.h.LV = function(a, b) {
            if (!this.ma())
                if (b) {
                    var c = g.mx(b);
                    if (g.Ca(c)) {
                        var d = "" + c.type;
                        c = c.data || {};
                        this.info("onYoutubeMessage_: " + d + " " + g.Jg(c));
                        switch (d) {
                            case "mdxSessionStatus":
                                SEa(this, c.screenId);
                                break;
                            default:
                                E7(this, "Unknown youtube message: " + d)
                        }
                    } else
                        E7(this, "Unable to parse message.")
                } else
                    E7(this, "No data in message.")
        }
        ;
        g.h.Pz = function(a, b, c, d) {
            PEa(this.J, this.A.label, a, this.A.friendlyName, (0,
                g.A)(function(e) {
                e ? b(e) : 0 <= d ? (E7(this, "Screen " + a + " appears to be offline. " + d + " retries left."),
                    g.mE((0,
                        g.A)(this.Pz, this, a, b, c, d - 1), 300)) : c(Error("Unable to fetch screen."))
            }, this), c)
        }
        ;
        g.h.kG = function() {
            return this.o
        }
        ;
        g.h.NX = function(a) {
            this.ma() || a || (E7(this, "Cast session died."),
                this.ze())
        }
        ;
        g.B(G7, D7);
        g.h = G7.prototype;
        g.h.Yv = function(a) {
            this.C = a;
            this.C.addUpdateListener(this.L)
        }
        ;
        g.h.qk = function(a) {
            this.D = a;
            this.G()
        }
        ;
        g.h.stop = function() {
            this.o();
            this.o = g.z;
            g.oE(this.F);
            this.C ? this.C.stop((0,
                g.A)(this.ze, this, null), (0,
                g.A)(this.ze, this, "Failed to stop DIAL device.")) : this.ze()
        }
        ;
        g.h.X = function() {
            this.o();
            this.o = g.z;
            g.oE(this.F);
            this.C && this.C.removeUpdateListener(this.L);
            this.C = null;
            G7.ea.X.call(this)
        }
        ;
        g.h.QX = function(a) {
            this.ma() || a || (E7(this, "DIAL session died."),
                this.o(),
                this.o = g.z,
                this.ze())
        }
        ;
        g.h.St = function(a) {
            this.K = t6();
            if (this.D) {
                var b = new window.chrome.cast.DialLaunchResponse(!0,VEa(this));
                a(b);
                UEa(this)
            } else
                this.G = (0,
                    g.A)(function() {
                    g.oE(this.F);
                    this.G = g.z;
                    this.F = window.NaN;
                    var b = new window.chrome.cast.DialLaunchResponse(!0,VEa(this));
                    a(b);
                    UEa(this)
                }, this),
                    this.F = g.mE((0,
                        g.A)(function() {
                        this.G()
                    }, this), 100)
        }
        ;
        g.h.uM = function(a, b, c) {
            PEa(this.J, this.H.receiver.label, a, this.A.friendlyName, (0,
                g.A)(function(a) {
                a && a.token ? (this.Tp(a),
                    b(new window.chrome.cast.DialLaunchResponse(!1))) : this.St(b, c)
            }, this), (0,
                g.A)(function(a) {
                E7(this, "Failed to get DIAL screen: " + a);
                this.St(b, c)
            }, this))
        }
        ;
        g.B(H7, D7);
        H7.prototype.stop = function() {
            this.ze()
        }
        ;
        H7.prototype.Yv = g.z;
        H7.prototype.qk = function() {
            g.oE(this.o);
            this.o = window.NaN;
            var a = v6(this.J.te(), this.A.label);
            a ? this.Tp(a) : this.ze(Error("No such screen"))
        }
        ;
        H7.prototype.X = function() {
            g.oE(this.o);
            this.o = window.NaN;
            H7.ea.X.call(this)
        }
        ;
        g.B(I7, g.XF);
        g.h = I7.prototype;
        g.h.init = function(a, b) {
            window.chrome.cast.timeout.requestSession = 3E4;
            var c = new window.chrome.cast.SessionRequest(this.G);
            this.H || (c.dialRequest = new window.chrome.cast.DialRequest("YouTube"));
            var d = window.chrome.cast.AutoJoinPolicy.TAB_AND_ORIGIN_SCOPED
                , e = a ? window.chrome.cast.DefaultActionPolicy.CAST_THIS_TAB : window.chrome.cast.DefaultActionPolicy.CREATE_SESSION;
            c = new window.chrome.cast.ApiConfig(c,(0,
                g.A)(this.OD, this),(0,
                g.A)(this.qU, this),d,e);
            c.customDialLaunchCallback = (0,
                g.A)(this.iS, this);
            window.chrome.cast.initialize(c, (0,
                g.A)(function() {
                this.ma() || (window.chrome.cast.addReceiverActionListener(this.C),
                    CEa(),
                    this.A.subscribe("onlineScreenChange", (0,
                        g.A)(this.jG, this)),
                    this.B = XEa(this),
                    window.chrome.cast.setCustomReceivers(this.B, g.z, (0,
                        g.A)(function(a) {
                        this.hc("Failed to set initial custom receivers: " + g.Jg(a))
                    }, this)),
                    this.V("yt-remote-cast2-availability-change", K7(this)),
                    b(!0))
            }, this), (0,
                g.A)(function(a) {
                this.hc("Failed to initialize API: " + g.Jg(a));
                b(!1)
            }, this))
        }
        ;
        g.h.EW = function(a, b) {
            J7("Setting connected screen ID: " + a + " -> " + b);
            if (this.o) {
                var c = this.o.B;
                if (!a || c && c.id != a)
                    J7("Unsetting old screen status: " + this.o.A.friendlyName),
                        L7(this, null)
            }
            if (a && b) {
                if (!this.o) {
                    c = v6(this.A.te(), a);
                    if (!c) {
                        J7("setConnectedScreenStatus: Unknown screen.");
                        return
                    }
                    var d = WEa(this, c);
                    d || (J7("setConnectedScreenStatus: Connected receiver not custom..."),
                        d = new window.chrome.cast.Receiver(c.uuid ? c.uuid : c.id,c.name),
                        d.receiverType = window.chrome.cast.ReceiverType.CUSTOM,
                        this.B.push(d),
                        window.chrome.cast.setCustomReceivers(this.B, g.z, (0,
                            g.A)(function(a) {
                            this.hc("Failed to set initial custom receivers: " + g.Jg(a))
                        }, this)));
                    J7("setConnectedScreenStatus: new active receiver: " + d.friendlyName);
                    L7(this, new H7(this.A,d), !0)
                }
                this.o.Zv(b)
            } else
                J7("setConnectedScreenStatus: no screen.")
        }
        ;
        g.h.FW = function(a) {
            this.ma() ? this.hc("Setting connection data on disposed cast v2") : this.o ? this.o.qk(a) : this.hc("Setting connection data without a session")
        }
        ;
        g.h.PX = function() {
            this.ma() ? this.hc("Stopping session on disposed cast v2") : this.o ? (this.o.stop(),
                L7(this, null)) : J7("Stopping non-existing session")
        }
        ;
        g.h.requestSession = function() {
            window.chrome.cast.requestSession((0,
                g.A)(this.OD, this), (0,
                g.A)(this.LU, this))
        }
        ;
        g.h.X = function() {
            this.A.unsubscribe("onlineScreenChange", (0,
                g.A)(this.jG, this));
            window.chrome && window.chrome.cast && window.chrome.cast.removeReceiverActionListener(this.C);
            g.Ta(g.y("yt.mdx.remote.debug.handlers_") || [], zEa);
            g.kf(this.o);
            I7.ea.X.call(this)
        }
        ;
        g.h.hc = function(a) {
            n7("Controller", a)
        }
        ;
        g.h.PD = function(a, b) {
            this.o == a && (b || L7(this, null),
                this.V("yt-remote-cast2-session-change", b))
        }
        ;
        g.h.mU = function(a, b) {
            if (!this.ma())
                if (a)
                    switch (a.friendlyName = window.chrome.cast.unescape(a.friendlyName),
                        J7("onReceiverAction_ " + a.label + " / " + a.friendlyName + "-- " + b),
                        b) {
                        case window.chrome.cast.ReceiverAction.CAST:
                            if (this.o)
                                if (this.o.A.label != a.label)
                                    J7("onReceiverAction_: Stopping active receiver: " + this.o.A.friendlyName),
                                        this.o.stop();
                                else {
                                    J7("onReceiverAction_: Casting to active receiver.");
                                    this.o.B && this.V("yt-remote-cast2-session-change", this.o.B);
                                    break
                                }
                            switch (a.receiverType) {
                                case window.chrome.cast.ReceiverType.CUSTOM:
                                    L7(this, new H7(this.A,a));
                                    break;
                                case window.chrome.cast.ReceiverType.DIAL:
                                    L7(this, new G7(this.A,a,this.F));
                                    break;
                                case window.chrome.cast.ReceiverType.CAST:
                                    L7(this, new F7(this.A,a));
                                    break;
                                default:
                                    this.hc("Unknown receiver type: " + a.receiverType)
                            }
                            break;
                        case window.chrome.cast.ReceiverAction.STOP:
                            this.o && this.o.A.label == a.label ? this.o.stop() : this.hc("Stopping receiver w/o session: " + a.friendlyName)
                    }
                else
                    this.hc("onReceiverAction_ called without receiver.")
        }
        ;
        g.h.iS = function(a) {
            if (this.ma())
                return window.Promise.reject(Error("disposed"));
            var b = a.receiver;
            b.receiverType != window.chrome.cast.ReceiverType.DIAL && (this.hc("Not DIAL receiver: " + b.friendlyName),
                b.receiverType = window.chrome.cast.ReceiverType.DIAL);
            var c = this.o ? this.o.A : null;
            if (!c || c.label != b.label)
                return this.hc("Receiving DIAL launch request for non-clicked DIAL receiver: " + b.friendlyName),
                    window.Promise.reject(Error("illegal DIAL launch"));
            if (c && c.label == b.label && c.receiverType != window.chrome.cast.ReceiverType.DIAL) {
                if (this.o.B)
                    return J7("Reselecting dial screen."),
                        this.V("yt-remote-cast2-session-change", this.o.B),
                        window.Promise.resolve(new window.chrome.cast.DialLaunchResponse(!1));
                this.hc('Changing CAST intent from "' + c.receiverType + '" to "dial" for ' + b.friendlyName);
                L7(this, new G7(this.A,b,this.F))
            }
            b = this.o;
            b.H = a;
            return b.H.appState == window.chrome.cast.DialAppState.RUNNING ? new window.Promise((0,
                g.A)(b.uM, b, (b.H.extraData || {}).screenId || null)) : new window.Promise((0,
                g.A)(b.St, b))
        }
        ;
        g.h.OD = function(a) {
            if (!this.ma()) {
                J7("New cast session ID: " + a.sessionId);
                var b = a.receiver;
                if (b.receiverType != window.chrome.cast.ReceiverType.CUSTOM) {
                    if (!this.o)
                        if (b.receiverType == window.chrome.cast.ReceiverType.CAST)
                            J7("Got resumed cast session before resumed mdx connection."),
                                b.friendlyName = window.chrome.cast.unescape(b.friendlyName),
                                L7(this, new F7(this.A,b), !0);
                        else {
                            this.hc("Got non-cast session without previous mdx receiver event, or mdx resume.");
                            return
                        }
                    var c = this.o.A
                        , d = v6(this.A.te(), c.label);
                    d && q6(d, b.label) && c.receiverType != window.chrome.cast.ReceiverType.CAST && b.receiverType == window.chrome.cast.ReceiverType.CAST && (J7("onSessionEstablished_: manual to cast session change " + b.friendlyName),
                        g.kf(this.o),
                        this.o = new F7(this.A,b),
                        this.o.subscribe("sessionScreen", (0,
                            g.A)(this.PD, this, this.o)),
                        this.o.qk(null));
                    this.o.Yv(a)
                }
            }
        }
        ;
        g.h.OX = function() {
            return this.o ? this.o.kG() : null
        }
        ;
        g.h.LU = function(a) {
            this.ma() || (this.hc("Failed to estabilish a session: " + g.Jg(a)),
            a.code != window.chrome.cast.ErrorCode.CANCEL && L7(this, null))
        }
        ;
        g.h.qU = function(a) {
            J7("Receiver availability updated: " + a);
            if (!this.ma()) {
                var b = K7(this);
                this.D = a == window.chrome.cast.ReceiverAvailability.AVAILABLE;
                K7(this) != b && this.V("yt-remote-cast2-availability-change", K7(this))
            }
        }
        ;
        g.h.jG = function() {
            this.ma() || (this.B = XEa(this),
                J7("Updating custom receivers: " + g.Jg(this.B)),
                window.chrome.cast.setCustomReceivers(this.B, g.z, (0,
                    g.A)(function() {
                    this.hc("Failed to set custom receivers.")
                }, this)),
                this.V("yt-remote-cast2-availability-change", K7(this)))
        }
        ;
        I7.prototype.setLaunchParams = I7.prototype.FW;
        I7.prototype.setConnectedScreenStatus = I7.prototype.EW;
        I7.prototype.stopSession = I7.prototype.PX;
        I7.prototype.getCastSession = I7.prototype.OX;
        I7.prototype.requestSession = I7.prototype.requestSession;
        I7.prototype.init = I7.prototype.init;
        I7.prototype.dispose = I7.prototype.dispose;
        var R7 = [];
        g.h = W7.prototype;
        g.h.reset = function(a) {
            this.listId = "";
            this.index = -1;
            this.videoId = "";
            X7(this);
            this.volume = -1;
            this.muted = !1;
            a && (this.index = a.index,
                this.listId = a.listId,
                this.videoId = a.videoId,
                this.o = a.playerState,
                this.volume = a.volume,
                this.muted = a.muted,
                this.audioTrackId = a.audioTrackId,
                this.A = a.trackData,
                this.ag = a.hasPrevious,
                this.hasNext = a.hasNext,
                this.H = a.playerTime,
                this.G = a.playerTimeAt,
                this.D = a.seekableStart,
                this.B = a.seekableEnd,
                this.J = a.duration,
                this.K = a.loadedTime,
                this.C = a.liveIngestionTime,
                this.F = !(0,
                    window.isNaN)(this.C))
        }
        ;
        g.h.qb = function() {
            return 1 == this.o
        }
        ;
        g.h.isAdPlaying = function() {
            return 1081 == this.o
        }
        ;
        g.h.getDuration = function() {
            return this.F ? this.J + Y7(this) : this.J
        }
        ;
        g.h.clone = function() {
            return new W7(b8(this))
        }
        ;
        g.B(d8, g.XF);
        g.h = d8.prototype;
        g.h.play = function() {
            1 == this.o ? (this.A ? this.A.play(null, g.z, j8(this, "play")) : i8(this, "play"),
                h8(this, 1, $7(e8(this))),
                this.V("remotePlayerChange")) : f8(this, this.play)
        }
        ;
        g.h.pause = function() {
            1 == this.o ? (this.A ? this.A.pause(null, g.z, j8(this, "pause")) : i8(this, "pause"),
                h8(this, 2, $7(e8(this))),
                this.V("remotePlayerChange")) : f8(this, this.pause)
        }
        ;
        g.h.fG = function(a) {
            if (1 == this.o) {
                if (this.A) {
                    var b = e8(this)
                        , c = new window.chrome.cast.media.SeekRequest;
                    c.currentTime = a;
                    c.resumeState = b.qb() || 3 == b.o ? window.chrome.cast.media.ResumeState.PLAYBACK_START : window.chrome.cast.media.ResumeState.PLAYBACK_PAUSE;
                    this.A.seek(c, g.z, j8(this, "seekTo", {
                        newTime: a
                    }))
                } else
                    i8(this, "seekTo", {
                        newTime: a
                    });
                h8(this, 3, a);
                this.V("remotePlayerChange")
            } else
                f8(this, g.Fa(this.fG, a))
        }
        ;
        g.h.stop = function() {
            if (1 == this.o) {
                this.A ? this.A.stop(null, g.z, j8(this, "stopVideo")) : i8(this, "stopVideo");
                var a = e8(this);
                a.index = -1;
                a.videoId = "";
                X7(a);
                g8(this, a);
                this.V("remotePlayerChange")
            } else
                f8(this, this.stop)
        }
        ;
        g.h.setVolume = function(a, b) {
            if (1 == this.o) {
                var c = e8(this);
                if (this.B) {
                    if (c.volume != a) {
                        var d = Math.round(a) / 100;
                        this.B.setReceiverVolumeLevel(d, (0,
                            g.A)(function() {
                            n7("CP", "set receiver volume: " + d)
                        }, this), (0,
                            g.A)(function() {
                            this.hc("failed to set receiver volume.")
                        }, this))
                    }
                    c.muted != b && this.B.setReceiverMuted(b, (0,
                        g.A)(function() {
                        n7("CP", "set receiver muted: " + b)
                    }, this), (0,
                        g.A)(function() {
                        this.hc("failed to set receiver muted.")
                    }, this))
                } else {
                    var e = {
                        volume: a,
                        muted: b
                    };
                    -1 != c.volume && (e.delta = a - c.volume);
                    i8(this, "setVolume", e)
                }
                c.muted = b;
                c.volume = a;
                g8(this, c)
            } else
                f8(this, g.Fa(this.setVolume, a, b))
        }
        ;
        g.h.fF = function(a, b) {
            if (1 == this.o) {
                var c = e8(this)
                    , d = {
                    videoId: a
                };
                b && (c.A = {
                    trackName: b.name,
                    languageCode: b.languageCode,
                    sourceLanguageCode: b.translationLanguage ? b.translationLanguage.languageCode : "",
                    languageName: b.languageName,
                    format: b.format,
                    kind: b.kind
                },
                    d.style = g.Jg(b.style),
                    g.hc(d, c.A));
                i8(this, "setSubtitlesTrack", d);
                g8(this, c)
            } else
                f8(this, g.Fa(this.fF, a, b))
        }
        ;
        g.h.Ow = function(a, b) {
            if (1 == this.o) {
                i8(this, "setAudioTrack", {
                    videoId: a,
                    audioTrackId: b.Jb.id
                });
                var c = e8(this);
                c.audioTrackId = b.Jb.id;
                g8(this, c)
            } else
                f8(this, g.Fa(this.Ow, a, b))
        }
        ;
        g.h.eG = function(a, b) {
            if (1 == this.o) {
                if (a && b) {
                    var c = e8(this);
                    a8(c, a, b);
                    g8(this, c)
                }
                i8(this, "previous")
            } else
                f8(this, g.Fa(this.eG, a, b))
        }
        ;
        g.h.dG = function(a, b) {
            if (1 == this.o) {
                if (a && b) {
                    var c = e8(this);
                    a8(c, a, b);
                    g8(this, c)
                }
                i8(this, "next")
            } else
                f8(this, g.Fa(this.dG, a, b))
        }
        ;
        g.h.gz = function() {
            1 == this.o ? i8(this, "dismissAutoplay") : f8(this, this.gz)
        }
        ;
        g.h.dispose = function() {
            if (3 != this.o) {
                var a = this.o;
                this.o = 3;
                this.V("proxyStateChange", a, this.o)
            }
            d8.ea.dispose.call(this)
        }
        ;
        g.h.X = function() {
            jFa(this);
            this.C = null;
            this.D.clear();
            c8(this, null);
            d8.ea.X.call(this)
        }
        ;
        g.h.Pw = function(a) {
            if ((a != this.o || 2 == a) && 3 != this.o && 0 != a) {
                var b = this.o;
                this.o = a;
                this.V("proxyStateChange", b, a);
                if (1 == a)
                    for (; !this.D.isEmpty(); )
                        g.GC(this.D).apply(this);
                else
                    3 == a && this.dispose()
            }
        }
        ;
        g.h.hU = function(a, b) {
            this.V(a, b)
        }
        ;
        g.h.FR = function(a) {
            if (!a)
                this.Lm(null),
                    c8(this, null);
            else if (this.B.receiver.volume) {
                a = this.B.receiver.volume;
                var b = e8(this)
                    , c = Math.round(100 * a.level || 0);
                if (b.volume != c || b.muted != a.muted)
                    n7("CP", "Cast volume update: " + a.level + (a.muted ? " muted" : "")),
                        b.volume = c,
                        b.muted = !!a.muted,
                        g8(this, b)
            }
        }
        ;
        g.h.Lm = function(a) {
            n7("CP", "Cast media: " + !!a);
            this.A && this.A.removeUpdateListener(this.H);
            if (this.A = a)
                this.A.addUpdateListener(this.H),
                    kFa(this),
                    this.V("remotePlayerChange")
        }
        ;
        g.h.ER = function(a) {
            a ? (kFa(this),
                this.V("remotePlayerChange")) : this.Lm(null)
        }
        ;
        g.h.RR = function() {
            var a = gFa();
            a && c8(this, a)
        }
        ;
        g.h.hc = function(a) {
            n7("CP", a)
        }
        ;
        g.B(k8, g.XF);
        g.h = k8.prototype;
        g.h.connect = function(a, b) {
            if (b) {
                var c = b.listId
                    , d = b.videoId
                    , e = b.playerParams
                    , f = b.clickTrackingParams
                    , k = b.index
                    , l = {
                    videoId: d
                }
                    , m = b.currentTime
                    , n = b.locationInfo;
                g.u(m) && (l.currentTime = 5 >= m ? 0 : m);
                e && (l.playerParams = e);
                n && (l.locationInfo = n);
                f && (l.clickTrackingParams = f);
                c && (l.listId = c);
                g.u(k) && (l.currentIndex = k);
                c && (this.gb.listId = c);
                this.gb.videoId = d;
                this.gb.index = k || 0;
                this.gb.state = 3;
                Z7(this.gb, m);
                this.C = "UNSUPPORTED";
                l8("Connecting with setPlaylist and params: " + g.Jg(l));
                this.o.connect({
                    method: "setPlaylist",
                    params: g.Jg(l)
                }, a, GDa())
            } else
                l8("Connecting without params"),
                    this.o.connect({}, a, GDa());
            mFa(this)
        }
        ;
        g.h.dispose = function() {
            this.ma() || (this.V("beforeDispose"),
                m8(this, 3));
            k8.ea.dispose.call(this)
        }
        ;
        g.h.X = function() {
            n8(this);
            p8(this);
            o8(this);
            g.oE(this.J);
            this.J = window.NaN;
            g.oE(this.K);
            this.K = window.NaN;
            this.B = null;
            g.HF(this.T);
            this.T.length = 0;
            this.o.dispose();
            k8.ea.X.call(this);
            this.C = this.G = this.A = this.gb = this.o = null
        }
        ;
        g.h.HK = function() {
            this.F(2)
        }
        ;
        g.h.JR = function() {
            l8("Channel opened");
            this.O && (this.O = !1,
                o8(this),
                this.M = g.mE((0,
                    g.A)(function() {
                    l8("Timing out waiting for a screen.");
                    this.F(1)
                }, this), 15E3));
            KDa(wEa(this.o), this.ba)
        }
        ;
        g.h.GR = function() {
            l8("Channel closed");
            (0,
                window.isNaN)(this.D) ? A6(!0) : A6();
            this.dispose()
        }
        ;
        g.h.HR = function(a) {
            A6();
            (0,
                window.isNaN)(this.H()) ? (l8("Channel error: " + a + " without reconnection"),
                this.dispose()) : (this.O = !0,
                l8("Channel error: " + a + " with reconnection in " + this.H() + " ms"),
                m8(this, 2))
        }
        ;
        g.h.IR = function(a) {
            a.params ? l8("Received: action=" + a.action + ", params=" + g.Jg(a.params)) : l8("Received: action=" + a.action + " {}");
            switch (a.action) {
                case "loungeStatus":
                    a = g.mx(a.params.devices);
                    this.A = (0,
                        g.I)(a, function(a) {
                        return new o6(a)
                    });
                    a = !!g.Ka(this.A, function(a) {
                        return "LOUNGE_SCREEN" == a.type
                    });
                    pFa(this, a);
                    break;
                case "loungeScreenDisconnected":
                    g.Ua(this.A, function(a) {
                        return "LOUNGE_SCREEN" == a.type
                    });
                    pFa(this, !1);
                    break;
                case "remoteConnected":
                    var b = new o6(g.mx(a.params.device));
                    g.Ka(this.A, function(a) {
                        return b ? a.id == b.id : !1
                    }) || g.Ra(this.A, b);
                    break;
                case "remoteDisconnected":
                    b = new o6(g.mx(a.params.device));
                    g.Ua(this.A, function(a) {
                        return b ? a.id == b.id : !1
                    });
                    break;
                case "gracefulDisconnect":
                    break;
                case "playlistModified":
                    rFa(this, a);
                    break;
                case "nowPlaying":
                    tFa(this, a);
                    break;
                case "onStateChange":
                    sFa(this, a);
                    break;
                case "onAdStateChange":
                    uFa(this, a);
                    break;
                case "onVolumeChanged":
                    vFa(this, a);
                    break;
                case "onSubtitlesTrackChanged":
                    qFa(this, a);
                    break;
                case "nowAutoplaying":
                    wFa(this, a);
                    break;
                case "autoplayDismissed":
                    this.V("autoplayDismissed");
                    break;
                case "autoplayUpNext":
                    this.G = a.params.videoId || null;
                    this.V("autoplayUpNext", this.G);
                    break;
                case "onAutoplayModeChanged":
                    this.C = a.params.autoplayMode;
                    this.V("autoplayModeChange", this.C);
                    "DISABLED" == this.C && this.V("autoplayDismissed");
                    break;
                case "onHasPreviousNextChanged":
                    xFa(this, a);
                    break;
                case "requestAssistedSignIn":
                    this.V("assistedSignInRequested", a.params.authCode);
                    break;
                default:
                    l8("Unrecognized action: " + a.action)
            }
        }
        ;
        g.h.nW = function() {
            if (this.B) {
                var a = this.B;
                this.B = null;
                this.gb.videoId != a && q8(this, "getNowPlaying")
            }
        }
        ;
        k8.prototype.subscribe = k8.prototype.subscribe;
        k8.prototype.unsubscribeByKey = k8.prototype.Yd;
        k8.prototype.ia = function() {
            var a = 3;
            this.ma() || (a = 0,
                (0,
                    window.isNaN)(this.H()) ? i7(this.o) && (0,
                    window.isNaN)(this.D) && (a = 1) : a = 2);
            return a
        }
        ;
        k8.prototype.getProxyState = k8.prototype.ia;
        k8.prototype.F = function(a) {
            l8("Disconnecting with " + a);
            n8(this);
            this.V("beforeDisconnect", a);
            1 == a && A6();
            xEa(this.o, a);
            this.dispose()
        }
        ;
        k8.prototype.disconnect = k8.prototype.F;
        k8.prototype.ha = function() {
            var a = this.gb;
            this.B && (a = this.gb.clone(),
                a8(a, this.B, a.index));
            return b8(a)
        }
        ;
        k8.prototype.getPlayerContextData = k8.prototype.ha;
        k8.prototype.oa = function(a) {
            var b = new W7(a);
            b.videoId && b.videoId != this.gb.videoId && (this.B = b.videoId,
                g.oE(this.J),
                this.J = g.mE((0,
                    g.A)(this.nW, this), 5E3));
            var c = [];
            this.gb.listId == b.listId && this.gb.videoId == b.videoId && this.gb.index == b.index || c.push("remoteQueueChange");
            this.gb.o == b.o && this.gb.volume == b.volume && this.gb.muted == b.muted && $7(this.gb) == $7(b) && g.Jg(this.gb.A) == g.Jg(b.A) || c.push("remotePlayerChange");
            this.gb.reset(a);
            (0,
                g.C)(c, function(a) {
                this.V(a)
            }, this)
        }
        ;
        k8.prototype.setPlayerContextData = k8.prototype.oa;
        k8.prototype.Z = function() {
            var a = this.o.F.id
                , b = g.Ka(this.A, function(b) {
                return "REMOTE_CONTROL" == b.type && b.id != a
            });
            return b ? b.id : ""
        }
        ;
        k8.prototype.getOtherConnectedRemoteId = k8.prototype.Z;
        k8.prototype.H = function() {
            var a = this.o;
            return a.A.isActive() ? a.A.A - (0,
                g.G)() : window.NaN
        }
        ;
        k8.prototype.getReconnectTimeout = k8.prototype.H;
        k8.prototype.aa = function() {
            return this.C || "UNSUPPORTED"
        }
        ;
        k8.prototype.getAutoplayMode = k8.prototype.aa;
        k8.prototype.da = function() {
            return this.G || ""
        }
        ;
        k8.prototype.getAutoplayVideoId = k8.prototype.da;
        k8.prototype.va = function() {
            if (!(0,
                window.isNaN)(this.H())) {
                var a = this.o.A;
                g.pu(a.o);
                a.start()
            }
        }
        ;
        k8.prototype.reconnect = k8.prototype.va;
        k8.prototype.ka = function(a, b) {
            q8(this, a, b);
            oFa(this)
        }
        ;
        k8.prototype.sendMessage = k8.prototype.ka;
        g.B(r8, r7);
        g.h = r8.prototype;
        g.h.te = function(a) {
            return this.hd.$_gs(a)
        }
        ;
        g.h.contains = function(a) {
            return !!this.hd.$_c(a)
        }
        ;
        g.h.get = function(a) {
            return this.hd.$_g(a)
        }
        ;
        g.h.start = function() {
            this.hd.$_st()
        }
        ;
        g.h.add = function(a, b, c) {
            this.hd.$_a(a, b, c)
        }
        ;
        g.h.remove = function(a, b, c) {
            this.hd.$_r(a, b, c)
        }
        ;
        g.h.Pq = function(a, b, c, d) {
            this.hd.$_un(a, b, c, d)
        }
        ;
        g.h.X = function() {
            for (var a = 0, b = this.A.length; a < b; ++a)
                this.hd.$_ubk(this.A[a]);
            this.A.length = 0;
            this.hd = null;
            r8.ea.X.call(this)
        }
        ;
        g.h.LX = function() {
            this.V("screenChange")
        }
        ;
        g.h.GT = function() {
            this.V("onlineScreenChange")
        }
        ;
        A7.prototype.$_st = A7.prototype.start;
        A7.prototype.$_gspc = A7.prototype.MX;
        A7.prototype.$_gsppc = A7.prototype.iG;
        A7.prototype.$_c = A7.prototype.contains;
        A7.prototype.$_g = A7.prototype.get;
        A7.prototype.$_a = A7.prototype.add;
        A7.prototype.$_un = A7.prototype.Pq;
        A7.prototype.$_r = A7.prototype.remove;
        A7.prototype.$_gs = A7.prototype.te;
        A7.prototype.$_gos = A7.prototype.hG;
        A7.prototype.$_s = A7.prototype.subscribe;
        A7.prototype.$_ubk = A7.prototype.Yd;
        var s8 = null
            , t8 = null
            , I8 = null
            , x8 = [];
        g.t(J8, g.M);
        g.h = J8.prototype;
        g.h.X = function() {
            g.M.prototype.X.call(this);
            this.C.stop();
            this.D.stop();
            this.L.stop();
            this.O();
            this.o.unsubscribe("proxyStateChange", this.LD, this);
            this.o.unsubscribe("remotePlayerChange", this.Om, this);
            this.o.unsubscribe("remoteQueueChange", this.Up, this);
            this.o.unsubscribe("autoplayUpNext", this.jD, this);
            this.o.unsubscribe("previousNextChange", this.ID, this);
            this.o.unsubscribe("nowAutoplaying", this.AD, this);
            this.o.unsubscribe("autoplayDismissed", this.iD, this);
            this.o = this.H = null
        }
        ;
        g.h.hC = function(a, b) {
            for (var c = [], d = 1; d < arguments.length; ++d)
                c[d - 1] = arguments[d];
            if (2 != this.o.o)
                if (M8(this)) {
                    if (!e8(this.o).isAdPlaying() || "control_seek" != a)
                        switch (a) {
                            case "control_toggle_play_pause":
                                e8(this.o).qb() ? this.o.pause() : this.o.play();
                                break;
                            case "control_play":
                                this.o.play();
                                break;
                            case "control_pause":
                                this.o.pause();
                                break;
                            case "control_seek":
                                this.K.Xj(c[0], c[1]);
                                break;
                            case "control_subtitles_set_track":
                                N8(this, c[0]);
                                break;
                            case "control_set_audio_track":
                                c = c[0],
                                M8(this) && this.o.Ow(this.A.getVideoData(1).videoId, c)
                        }
                } else
                    switch (a) {
                        case "control_toggle_play_pause":
                        case "control_play":
                        case "control_pause":
                            c = this.A.getCurrentTime();
                            O8(this, 0 == c ? void 0 : c);
                            break;
                        case "control_seek":
                            O8(this, c[0]);
                            break;
                        case "control_subtitles_set_track":
                            N8(this, c[0]);
                            break;
                        case "control_set_audio_track":
                            c = c[0],
                            M8(this) && this.o.Ow(this.A.getVideoData(1).videoId, c)
                    }
        }
        ;
        g.h.DR = function(a) {
            this.L.CK(a)
        }
        ;
        g.h.mX = function(a) {
            this.hC("control_subtitles_set_track", g.Zb(a) ? null : a)
        }
        ;
        g.h.vF = function() {
            var a = this.A.Ac("captions", "track");
            g.Zb(a) || N8(this, a)
        }
        ;
        g.h.yD = function(a) {
            if (M8(this)) {
                this.o.unsubscribe("remotePlayerChange", this.Om, this);
                var b = Math.round(a.volume);
                a = !!a.muted;
                var c = e8(this.o);
                if (b != c.volume || a != c.muted)
                    this.o.setVolume(b, a),
                        this.M.start();
                this.o.subscribe("remotePlayerChange", this.Om, this)
            }
        }
        ;
        g.h.ZS = function() {
            g.Zb(this.F) || JFa(this, this.F);
            this.G = !1
        }
        ;
        g.h.LD = function(a, b) {
            this.D.stop();
            2 == b && this.sF()
        }
        ;
        g.h.Om = function() {
            if (M8(this)) {
                this.C.stop();
                var a = e8(this.o);
                switch (a.o) {
                    case 1081:
                    case 1:
                        L8(this, new g.kQ(8));
                        this.rF();
                        break;
                    case 1085:
                    case 3:
                        L8(this, new g.kQ(9));
                        break;
                    case 1083:
                    case 0:
                        L8(this, new g.kQ(2));
                        this.K.stop();
                        K8(this, this.A.getVideoData().lengthSeconds);
                        break;
                    case 1084:
                        L8(this, new g.kQ(4));
                        break;
                    case 2:
                        L8(this, new g.kQ(4));
                        K8(this, $7(a));
                        break;
                    case -1:
                        L8(this, new g.kQ(64));
                        break;
                    case -1E3:
                        L8(this, new g.kQ(128,{
                            errorCode: "mdx.remoteerror",
                            message: "\u6b64\u89c6\u9891\u65e0\u6cd5\u8fdc\u7a0b\u64ad\u653e\u3002"
                        }))
                }
                a = e8(this.o).A;
                var b = this.F;
                (a || b ? a && b && a.trackName == b.trackName && a.languageCode == b.languageCode && a.languageName == b.languageName && a.format == b.format && a.kind == b.kind : 1) || (this.F = a,
                    JFa(this, a));
                a = e8(this.o);
                -1 == a.volume || Math.round(this.A.getVolume()) == a.volume && this.A.isMuted() == a.muted || this.M.isActive() || this.RF()
            } else
                IFa(this)
        }
        ;
        g.h.ID = function() {
            this.A.V("mdxpreviousnextchange")
        }
        ;
        g.h.Up = function() {
            M8(this) || IFa(this)
        }
        ;
        g.h.GJ = function() {
            this.o.gz()
        }
        ;
        g.h.jD = function(a) {
            a && (a = g.DE("/watch_queue_ajax", {
                method: "GET",
                dd: {
                    action_get_watch_queue_item: 1,
                    video_id: a
                },
                onSuccess: (0,
                    g.A)(this.lV, this)
            })) && (this.O = (0,
                g.A)(a.abort, a))
        }
        ;
        g.h.lV = function(a, b) {
            var c = new g.oP({
                videoId: b.videoId,
                title: b.title,
                author: b.author,
                murlmq_webp: b.url
            });
            this.suggestion = c;
            this.A.V("mdxautoplayupnext", c)
        }
        ;
        g.h.AD = function(a) {
            (0,
                window.isNaN)(a) || this.A.V("mdxnowautoplaying", a)
        }
        ;
        g.h.iD = function() {
            this.A.V("mdxautoplaycanceled")
        }
        ;
        g.h.CP = function(a, b) {
            -1 == e8(this.o).o ? O8(this, a) : b && this.o.fG(a)
        }
        ;
        g.h.RF = function() {
            if (M8(this)) {
                var a = e8(this.o);
                this.B.Ha(this.T);
                a.muted ? this.A.mute() : this.A.kg();
                this.A.setVolume(a.volume);
                this.T = this.B.R(this.A, "onVolumeChange", this.yD)
            }
        }
        ;
        g.h.rF = function() {
            this.C.stop();
            if (!this.o.ma()) {
                var a = e8(this.o);
                a.qb() && L8(this, new g.kQ(8));
                K8(this, $7(a));
                this.C.start()
            }
        }
        ;
        g.h.sF = function() {
            this.D.stop();
            this.C.stop();
            var a = this.o.C.getReconnectTimeout();
            2 == this.o.o && !(0,
                window.isNaN)(a) && this.D.start()
        }
        ;
        g.t(P8, g.W);
        P8.prototype.D = function(a) {
            LFa(this, a.state)
        }
        ;
        g.t(Q8, g.kZ);
        Q8.prototype.L = function() {
            var a = this.A.Ac("remote", "receivers");
            a && 1 < a.length && !this.A.Ac("remote", "quickCast") ? (this.J = g.kb(a, this.F, this),
                g.lZ(this, (0,
                    g.I)(a, this.F)),
                a = this.A.Ac("remote", "currentReceiver"),
                this.Af(this.F(a)),
                this.enable(!0)) : this.enable(!1)
        }
        ;
        Q8.prototype.F = function(a) {
            return a.key
        }
        ;
        Q8.prototype.zf = function(a) {
            return "cast-selector-receiver" == a ? "\u6295\u5c04\u2026" : this.J[a].name
        }
        ;
        Q8.prototype.zd = function(a) {
            g.kZ.prototype.zd.call(this, a);
            this.A.Td("remote", "currentReceiver", this.J[a]);
            this.D.Tb()
        }
        ;
        g.t(R8, g.GU);
        g.h = R8.prototype;
        g.h.create = function() {
            CFa(g.sN(g.Y(this.o)));
            this.F.push(g.iG("yt-remote-before-disconnect", this.yR, this));
            this.F.push(g.iG("yt-remote-connection-change", this.rU, this));
            this.F.push(g.iG("yt-remote-receiver-availability-change", this.JD, this));
            this.F.push(g.iG("yt-remote-auto-connect", this.pU, this));
            this.F.push(g.iG("yt-remote-receiver-resumed", this.oU, this));
            this.JD()
        }
        ;
        g.h.load = function() {
            this.o.Lu();
            g.GU.prototype.load.call(this);
            this.D = new J8(this,this.o,this.A);
            var a = (a = HFa()) ? a.currentTime : 0;
            var b = H8() ? new d8(C8(),void 0) : null;
            0 == a && b && (a = $7(e8(b)));
            0 != a && (this.J = a || 0,
                this.o.V("progresssync", a, void 0));
            KFa(this, this.G, this.G);
            g.L_(this.o.app, 6)
        }
        ;
        g.h.unload = function() {
            this.o.V("mdxautoplaycanceled");
            this.C = this.B;
            g.lf(this.D, this.A);
            this.A = this.D = null;
            g.GU.prototype.unload.call(this);
            g.L_(this.o.app, 5)
        }
        ;
        g.h.X = function() {
            g.jG(this.F);
            g.GU.prototype.X.call(this)
        }
        ;
        g.h.Em = function(a, b) {
            for (var c = [], d = 1; d < arguments.length; ++d)
                c[d - 1] = arguments[d];
            this.loaded && this.D.hC.apply(this.D, [a].concat(g.oa(c)))
        }
        ;
        g.h.xK = function() {
            return this.loaded ? this.D.suggestion : null
        }
        ;
        g.h.ag = function() {
            return this.A ? e8(this.A).ag : !1
        }
        ;
        g.h.hasNext = function() {
            return this.A ? e8(this.A).hasNext : !1
        }
        ;
        g.h.getCurrentTime = function() {
            return this.J
        }
        ;
        g.h.qP = function() {
            var a = e8(this.A)
                , b = this.o.getVideoData();
            return {
                allowSeeking: this.o.jd(),
                clipEnd: b.clipEnd,
                clipStart: b.clipStart,
                current: this.getCurrentTime(),
                displayedStart: -1,
                duration: a.getDuration(),
                ingestionTime: a.F ? a.C + Y7(a) : a.C,
                isPeggedToLive: 1 >= (a.F ? a.B + Y7(a) : a.B) - this.getCurrentTime(),
                loaded: a.K,
                seekableEnd: a.F ? a.B + Y7(a) : a.B,
                seekableStart: 0 < a.D ? a.D + Y7(a) : a.D
            }
        }
        ;
        g.h.rP = function() {
            this.A && this.A.dG()
        }
        ;
        g.h.sP = function() {
            this.A && this.A.eG()
        }
        ;
        g.h.yR = function(a) {
            1 == a && (this.K = this.A ? e8(this.A) : null)
        }
        ;
        g.h.rU = function() {
            var a = H8() ? new d8(C8(),void 0) : null;
            if (a) {
                var b = this.C;
                this.loaded && this.unload();
                this.A = a;
                this.K = null;
                b.key != this.B.key && (this.C = b,
                    this.load())
            } else
                g.kf(this.A),
                    this.A = null,
                this.loaded && (this.unload(),
                (a = this.K) && a.videoId == this.o.getVideoData().videoId && this.o.KB(a.videoId, $7(a)));
            this.o.V("videodatachange", "newdata", this.o.getVideoData(), 3)
        }
        ;
        g.h.JD = function() {
            this.H = [this.B].concat(EFa());
            var a = D8() || this.B;
            S8(this, a);
            this.o.xa("onMdxReceiversChange")
        }
        ;
        g.h.pU = function() {
            var a = D8();
            S8(this, a)
        }
        ;
        g.h.oU = function() {
            this.C = D8()
        }
        ;
        g.h.pP = function(a, b) {
            switch (a) {
                case "casting":
                    return this.loaded;
                case "receivers":
                    return this.H;
                case "currentReceiver":
                    return b && ("cast-selector-receiver" == b.key ? U7() : S8(this, b)),
                        this.loaded ? this.C : this.B;
                case "quickCast":
                    return 2 == this.H.length && "cast-selector-receiver" == this.H[1].key ? (b && U7(),
                        !0) : !1
            }
        }
        ;
        g.h.tP = function() {
            i8(this.A, "sendDebugCommand", {
                debugCommand: "stats4nerds "
            })
        }
        ;
        g.h.Dc = function() {
            return !1
        }
        ;
        g.xX.remote = R8;
    }
)(_yt_player);
